Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Enable Go To Definition for VSCode in VM#24540

Merged
danmoseley merged 1 commit into
dotnet:masterfrom
danmoseley:cppconfig2
May 20, 2019
Merged

Enable Go To Definition for VSCode in VM#24540
danmoseley merged 1 commit into
dotnet:masterfrom
danmoseley:cppconfig2

Conversation

@danmoseley
Copy link
Copy Markdown
Member

@danmoseley danmoseley commented May 12, 2019

This change enables VSCode to "go to definition" in the \vm\ folder. It contains no user-specific paths.

At this point it only includes the default, Windows configuration. This alone is helpful, and we can use it as the basis for improvement. This change does not affect anyone not using VS Code with the C++ extension.

It may be possible to improve this by using the CMAKE compile commands feature to remove hard coded defines, as well as by adding more platforms and configurations and supporting the rest of the tree.

@danmoseley danmoseley changed the title cpp config Enable Go To Definition for VSCode in VM May 12, 2019
@AaronRobinsonMSFT
Copy link
Copy Markdown
Member

I have a fix for the test failing on the ARM64 leg - see #24539

@danmoseley
Copy link
Copy Markdown
Member Author

@AaronRobinson perhaps you'd like to review?

Copy link
Copy Markdown
Member

@AaronRobinsonMSFT AaronRobinsonMSFT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is nice to have. My only fear is the slow march toward more and more IDE metadata being added to the source control. I like the intent, but fear the cruft.

@jkotas or @stephentoub Any opinions regarding this kind of IDE metadata that helps the developer experience?

@jkotas
Copy link
Copy Markdown
Member

jkotas commented May 14, 2019

I do not have an opinion. I do not use any of this for my day-to-day work.

@danmoseley
Copy link
Copy Markdown
Member Author

My hope is that the cruft does not build up much because we can use the cmake integration. Meantime it's just an experiment to see whether we can improve the VS Code experience for contributors.

@stephentoub
Copy link
Copy Markdown
Member

We have cpp code in the repo not under /vm/. We also have editor related files (e.g. .editorconfig) at the root of the repo. Sould this .vscode directory be at the root, too?

@janvorli
Copy link
Copy Markdown
Member

Nice. I've been using the same thing that I've created locally for my purposes and I haven't realized it might be something that would be worth checking in.

@janvorli
Copy link
Copy Markdown
Member

Btw, it is not just to enable go to definition. Another value it has that it also correctly shows blocks of code under specific defines as active or inactive (displayed in dimmed colors) based on the definitions in the config file.

@danmoseley
Copy link
Copy Markdown
Member Author

Sould this .vscode directory be at the root, too?

I'm learning how this works but my assumption is that we need a separate folder for each unique set of include paths and defines, or some approximate group. The defines and include paths for eg., \vm and \classlibrary are not the same (although mostly the same). Eg., the latter does not define WRITE_BARRIER_CHECK=1 . It may not matter much in practice of course. I"ll merge this and we can refine over time.

@danmoseley danmoseley merged commit ed790a8 into dotnet:master May 20, 2019
@danmoseley danmoseley deleted the cppconfig2 branch May 20, 2019 19:49
@danmoseley
Copy link
Copy Markdown
Member Author

BTW I think this will really be valuable when they implement Find References. It is the #2 ask for the VSCode C++ plugin and it appears as if it will come soon.
microsoft/vscode-cpptools#15

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants