I am using Visual Studio 2017.
I can expand and collapse in .cs files using command as follows:
Expand CTRL+M+L
Collapse CTRL+M+O
But same is not working in .cshtml file? Is there any workaround?
Ctrl+M+A collapses all, Ctrl+M+X expands all in my installation. You can see them by opening Tools > Options..., select Keyboard under Environment. In the Show commands containing, find Edit.CollapseAllOutlining (you can search too) and Edit.ExpandAllOutlining. You should be able to see the existing binding or add your own (make sure to select Text Editor or Global).
From what I could determine, Visual Studio doesn't support expanding and collapsing for this file type.
There is a sort of workaround, although it has its limitations. You can manually select regions in a given file that you'd like to hide and press Ctrl+MCtrl+H (also found in the Edit->Outlining menu) to hide them. Visual Studio will "remember" that you want these specific regions to be hideable, and you can now show and hide these sections with the outlining commands (for example Ctrl+MCtrl+A will hide all sections, and Ctrl+MCtrl+X will show all sections, depending on your keybindings).
This isn't a perfect solution by any means, because you need to set up the regions manually. But it might come in handy in some cases.
Here's an example of a .cshtml file after I set up the regions:
...and after pressing Ctrl+M+L once:
Related
Currently when I press Ctrl+Space while having the cursor in the function parentheses Visual Studio Intellisense offers me everything it can possibly think of. Is there a way to restrict these names to names that make sense for that specific function / parameters / context?
I can click on the little button "Variables and Constants" which helps somewhat but I have to click on that every time this list is invoked.
(If I remember correctly Eclipse first offered only the relevant names/variables for the current context, then pressing Ctrl+Space again offered a wider range of names.)
VS has the feature to give priority to variables, parameters, methods(mixed types) according to your current block domain rather than simply provide a single type.
So I think there is some problems with your environment, please try these:
1) disable any third party extensions under Extensions-->Manage Extensions-->Installed to check if there is an extension causing that.
2) reset vs settings under Tools-->Import and Export Settings-->Reset all settings
3) close VS, delete C:\Users\Administrator\AppData\Local\Microsoft\VisualStudio\16.0_xxx\ComponentModelCache folder
Also, delete .vs hidden folder under your solution folder, bin and obj folder.
restart VS to test again.
4) repair vs or update it if there is a new release version.
We are starting to look at the new WebLayout feature of TFS 2017.
I understand the system controls and that Microsoft has limited this on purpose.
What we currently have for the work items is a textbox above the AttachmentControl that shows some instructions on how to use the attachment Control, or better how not to use it. As well as a network path to the server to use in case of very large attachments.
I can't seem to find a away to add items to the new Attachment tab. The control is currently page wide on the new tab and no way to add additional controls to that tab.
Is there a workaround that would allow me to add a control to this tab ?
No. You cannot modify system controls. You could write an extension that pops up your warning text, but you'd have to add it to one of the available "contribution" points.
I'm making an angular webapp for a C# solution and I have to use TFS.
I set my workspace as local (as described here) and added the angular folder from Source Control Explorer.
Now all existing files are marked with the [add] tag and I can check-in them, but I can't understand why added or removed files are not detected as pending changes.
What am I missing?
They're under "Excluded" changes. You'll see a marker that says "Detected: X adds" or "Y removes". You can click it to promote them to tracked changes. It assumes that stuff that's being added or removed outside of Visual Studio isn't intended to be in source control, so it doesn't start tracking until you tell it that you want them to be tracked.
This may not be the perfect solution you're looking for, but I ran into an almost identical issue. This is how I solved it,
1) Open Solution Explorer in Visual Studio
2) Find your Project ( Angular Project )
3) Right click on it, and click Compare changes.
4) In compare options see View Options and check the following:
Show items that exist only in source path
Show items that exist only in target path
Show items that are different
5) Then find all the files that are in your local mapping that are missing from your server version, right click on them and click "Add file". You should be able to do this for entire folders / groups of files using shift + click .
6) Once you've added all your missing files, make sure they're being tracked in Team Explorer -> Pending changes, then check in your files.
I haven't figured out how to get Visual Studio to track these files automatically as I believe it requires a solution file like in normal C# projects to track them, but I could be wrong.
I'm trying to work with vscode in my WebSharper project (Ionide plugin seems... Whoah!) but when I load the fsproj into vscode, files in the explorer are ordered by name, not by "F# precedence". How can I configure vscode so that files are correctly ordered? Thank you.
The VS-like project explorer has been added to Ionide recently. It includes assembly references, project references, and ordered files (including folder supports). We've also added several commands to manipulate project and file order, you can access them with right-click context menu on this new project explorer
In Visual Studio Code you press Ctrl + Shift + P, then enter "F#: Move File Up".
If you have activated the great ionide plugin you can navigate to the F# symbol on the activity bar. This will open the project explorer which allows you to reorder files using the arrow icons:
This will change the order of the files (<Compile Include="xyz.fs" /> statements) in your .fsproj file (which is what you would have to do manually if you're not using the ionide plugin).
Without any plugin, VSCode 1.66 (March 2022) should support a better order support.
See issue 32592:
ordering of files is really important for the F# projects, and we provide couple of helper commands to manage it (move file up/down etc).
Those commands work more or less, but I don't think it's best UX.
I think it would be super nice if users had ability to use normal drag and drop to manipulate the order - just as they are able to manipulate files in normal file explorer (drag and drop files to move them to subfolder for example)
It is currently released in VSCode insider, with commit c468903 ("Finalize tree drag and drop API").
When viewing a whole shelveset diff in TFS Web Access, the largest source files are accompanied with a yellow bar that says "Displayed content is truncated due to maximum viewable content limit."
When I click on that single large file to see just its diff, I get another yellow bar. This time it says "The file contents were truncated since they exceeded the maximum file content length. Browse to the individual files to download full content."
Okay, maybe this tool just won't show large files to me.
How do I "browse to the individual files" as the yellow bar suggests? Will that give me both versions that I need to diff (shelved and unmodified)?
Is the size limit configurable anywhere?
Is there any way to use TFS Web Access with a
user configurable diff tool? (I would have many other good uses for that.)
The only workaround I am aware of is to open Visual Studio, painfully look up the shelveset, and view it using my configured diff tool which doesn't care whether the source files are obese or not.
I'm using TFS version 12.0.30324.0.
If you select just a single file you should get a download button. Clicking this will retrieve just that single file in it's entirety.
On non-shelvesets it's next to the edit button, but I dought that edit is available on shelvesets.
After asking, I discovered some other ways to search and found out that this limitation is specific to TFS 2012 and unpatched TFS 2013. Maybe this helps someone.
(This does not solve my own problem as I cannot quickly achieve TFS server upgrade so I'm still interested in a better answer. I'd like to extend my knowledge of TFS Web Access and I found the online resources lacking.)