Skip to content
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

semantic highlight prototype for TypeScript/JavaScript #88431

Merged
merged 32 commits into from Jan 14, 2020
Merged

Conversation

@aeschli
Copy link
Contributor

aeschli commented Jan 10, 2020

Prototype of a SemanticTokensProvider for TypeScript/JavaScript, relying on the experimental encodedSemanticClassifications-full request from the TypeScript server.

As the results returned by the TypeScript server are limited, we also add a Typescript plugin (typescript-vscode-sh-plugin) to enrich more token classifications that not only consist of Token types but also token modifiers.

Once we have validated out APIs we will talk to the TypeScript team to adopt the changes.

@mjbvz Ok, if I push this to master?
I'm also looking into a setting so this can be turned off if we find any issues.

@aeschli aeschli requested a review from mjbvz Jan 10, 2020
@aeschli aeschli self-assigned this Jan 10, 2020
@aeschli

This comment has been minimized.

Copy link
Contributor Author

aeschli commented Jan 13, 2020

@mjbvz I added version checks on both the client and plugin side.
Also there's now a setting in the editor to turn off semantic highlighting (also supports language specific setting, if needed): editor.semanticHighlighting.enabled

@aeschli aeschli requested a review from mjbvz Jan 13, 2020
@aeschli

This comment has been minimized.

Copy link
Contributor Author

aeschli commented Jan 13, 2020

To test add a settings like:

    "editor.tokenColorCustomizationsExperimental": {
        "parameter": {
            "fontStyle": "underline"
        }
    },
aeschli and others added 9 commits Jan 13, 2020
Add view-moving functionality to viewsservice which has been renamed to viewdescriptorservice. also includes outline view moving
sbatten and others added 6 commits Jan 13, 2020
* fix(debug): don't insert task boundaries between events

See discussion in microsoft/vscode-js-debug#206.

This PR adjusts logic such that we only assert task boundaries around
requests and responses, rather than around every single event. I believe
this will solve the primary case where misordering can happen, as given
in the existing unit test and described more verbosely in the doc
comment in this PR.

A more conservative approach would be to only omit the boundary between
events of the same type. That would be safer, but I browsing through
the code I didn't see any cases where it looked like we could get
tripped up by bucketing here (e.g. cases where we resolve a deferred
promise in an event handler).

Seems to fix the performance issue for me.

* fixup! add unit tests for ordering
@mjbvz
mjbvz approved these changes Jan 13, 2020
Copy link
Contributor

mjbvz left a comment

TS changes look good to me. The core editor changes also look good but make sure someone else also reviews those

@@ -0,0 +1,34 @@
{

This comment has been minimized.

Copy link
@mjbvz

mjbvz Jan 13, 2020

Contributor

Looks like this file got included by mistake


const builder = new vscode.SemanticTokensBuilder();
for (const tokenSpan of allTokenSpans) {
for (let i = 0, len = Math.floor(tokenSpan.length / 3); i < len; i++) {

This comment has been minimized.

Copy link
@mjbvz

mjbvz Jan 13, 2020

Contributor

Can we please extract some of these numbers to named variables

aeschli added 2 commits Jan 14, 2020
@aeschli aeschli merged commit 5ee9f66 into master Jan 14, 2020
3 of 6 checks passed
3 of 6 checks passed
linux linux
Details
windows windows
Details
darwin
Details
VS Code #20200114.29 failed
Details
VS Code Distro Sync & Merge Check #20200114.15 succeeded
Details
license/cla All CLA requirements met.
Details
@aeschli aeschli deleted the aeschli/ts-sem branch Jan 14, 2020
@aeschli aeschli added this to the January 2020 milestone Jan 14, 2020
@alexdima

This comment has been minimized.

FYI @aeschli I will remove this because VS Code is written to handle this correctly.

i.e. in the core, the document version when the request is made is remembered and then when the result comes in, the result will be "adjusted" with the same adjusting code running when typing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
You can’t perform that action at this time.