-
Notifications
You must be signed in to change notification settings - Fork 824
[WIP] use Layout as a source data of classification related tasks #2070
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Woohoo! I've been waiting for this PR for so long. |
It's just fantastic 🥇 🥇 🥇 |
@vladima do I understand right that this color information can be used for normal semantic code highlighting in the editor? |
I'm not sure that I understand the question: compiler uses layouts to pretty print various kinds of messages but it is not used to format the source text itself. For classification in the editor one should use |
@saul including the apostrophe is correct, the current highlighting in the editor is wrong |
per F# spec:
so I read it as |
Another small issue - I've noticed that "Full name: XXX" seems to be indented by a couple of spaces. This is not the case on master without your PR, so looks like a bug |
Wow, this is fantastic! |
This is OK as long as FSharp.Core is stable - for various reasons we have been making pretty regular breaking changes in the surface arera of FSharp.Compiler.Service, and bumping major version numbers on the nuget package when we do. |
If anyone wants to make some basic improvements like
etc that would also be great |
@dotnet-bot test this please |
Colors for module and namespace keywords are fixed. As for indentation I do agree that it is inconsistent with other cases however I'd prefer to fix this in a separate PR. Reasons:
// cc @KevinRansom and @dsyme for opinions. |
One last issue @vladima, see how the separators look in current master: Note that there are no blank lines around the separator, and there is no separator at the end of the tooltip. See @vasily-kirichenko's first screenshot in his last comment: |
@vladima Agreed re: indentation - unless it's a minor change, adding more improvements to this PR will make it more difficult to review and get merged. |
@vasily-kirichenko I've noticed the Async tooltip exploding in size in #1973 as well. Perhaps there's some strange code path executed for Async where it's not truncated, because in most situations it cuts off with a |
This looks good to me. Unless there are other concerns I think we should accept this |
Thank you this is awesome work ... Kevin |
…tnet#2070) * use Layout as a source data of classification related tasks * fix indentation * parse xml doc by hand instead of relying on VS service * revert back old API * fix portable build * fix output in FSI * fix printing of operators * update Surface test * internalize new types and modules * tag module/namespace as keywords * fix tooltip formatting for types with hidden representation * fix separator placement
Early WIP
F# compiler uses
Layout
structure for pretty printing but ultimately outputs result as a string. This become a culprit in classification related scenarios since in order to colorize everything nicely we have to effectively recover originalLayout
. This PR introducesTaggedText
annotations for text chunks inLayout
. Later annotated text chunks can easily be converted from theLayout
to RoslynTaggedText
.Remaining items:
Layout
should be added instead of replacing existing ones.per @vasily-kirichenko' comment:
Quick info:

Signature help:

Completion details:
