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

First step at the Visualforce Language Server #151

Merged
merged 15 commits into from
Oct 6, 2017

Conversation

vazexqi
Copy link
Contributor

@vazexqi vazexqi commented Sep 29, 2017

What does this PR do?

This is the first step toward our own Visualforce language server.

This PR bundles the existing HTML language server from VS Code. This mimics the behavior of the current Visualforce extension. The existing HTML extension actually uses a combination of HTML, JavaScript, and CSS language servers since you can have all three in a .html file (similarly you can do that too in a .page and .component file).

The old extension exists alongside this new extension so that we can easily have parity first before adding Visualforce specific features. This new extension is not published to the marketplace.

What is out of the scope of this PR?

This PR doesn't make this the default language server for .page and .components yet. We will do that once we have done more extensive testing and also renaming of preferences (so that we don't share any with the html setting).

What issues does this PR fix or reference?

@W-4344488@

"mocha": "3.2.0",
"shx": "0.2.2"
},
"scripts": {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@DatGuyJonathan - I removed the vscode:publish here so that should prevent it from being published to the marketplace for now. This is the main thing I want you to check (to see if I might have forgotten something).

@vazexqi
Copy link
Contributor Author

vazexqi commented Sep 29, 2017

screen shot 2017-09-29 at 2 02 47 pm

Another issue to be aware of is that the current version of the HTML extension uses a proposed API for color provider (microsoft/vscode#34366). It looks like this proposed API might be stable in the next version. Without stabilization, the only lost of functionality is that we don't provide the color preview when you use a color name, hex, rgb in the .page and .component.

So if you run the extension in debug mode it will run.
But if you generate the .vsix and install it into Code, it will show that error.

Also, anything that uses enableProposedApi also cannot be published to the marketplace. Hence, why this won't be a replacement until later.

"test": "node ./node_modules/vscode/bin/test"
},
"activationEvents": ["workspaceContains:sfdx-project.json"],
"enableProposedApi": true,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is where we enable the proposedApi

): Disposable;
}

/**
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This line and below are the proposed color API that we are using. The above are not being used.

This vscode.proposed.d.ts was copied from this particular version microsoft/vscode@a7ad71b#diff-4878e8b25d41f2ab7c2715852b1b97aa

@@ -0,0 +1,316 @@
/*---------------------------------------------------------------------------------------------
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The idea of embedding this file is from microsoft/vscode#25784

@codecov
Copy link

codecov bot commented Sep 29, 2017

Codecov Report

Merging #151 into develop will decrease coverage by 8.14%.
The diff coverage is 62.88%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #151      +/-   ##
===========================================
- Coverage    79.43%   71.28%   -8.15%     
===========================================
  Files           82      110      +28     
  Lines         2767     5475    +2708     
  Branches       371      709     +338     
===========================================
+ Hits          2198     3903    +1705     
- Misses         505     1423     +918     
- Partials        64      149      +85
Impacted Files Coverage Δ
...ackages/salesforcedx-vscode-lightning/src/index.ts 73.33% <ø> (ø) ⬆️
...arkup-language-server/src/services/tagProviders.ts 100% <100%> (ø)
...anguage-server/src/services/htmlSymbolsProvider.ts 100% <100%> (ø)
...-markup-language-server/src/htmlLanguageService.ts 100% <100%> (ø)
...alforce-markup-language-server/src/utils/arrays.ts 100% <100%> (ø)
...x-visualforce-language-server/src/modes/cssMode.ts 30.55% <30.55%> (ø)
...lforce-language-server/src/modes/javascriptMode.ts 42.28% <42.28%> (ø)
...rce-markup-language-server/src/parser/razorTags.ts 44.44% <44.44%> (ø)
...ualforce-language-server/src/languageModelCache.ts 45.65% <45.65%> (ø)
...-visualforce-language-server/src/modes/htmlMode.ts 48.71% <48.71%> (ø)
... and 48 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 74fc782...1fc921d. Read the comment docs.

Nick Chen added 7 commits October 5, 2017 13:16
This is a first pass. It is launching and basic functionality is there but there are quirks with how it displays the colors with the new API.

@W-4344488@
This way, both can continue to exist in the same repository to ease development and comparison.

@W-4344488@
Now both of them can coexist, but only the previous one will be published.

@W-4344488@
@vazexqi vazexqi force-pushed the nick/visualforce-language-server branch from d7d24d4 to 474f1b9 Compare October 5, 2017 20:32
@vazexqi vazexqi merged commit 76b8472 into develop Oct 6, 2017
@chowwinston-zz chowwinston-zz deleted the nick/visualforce-language-server branch November 14, 2017 00:59
@chowwinston-zz chowwinston-zz restored the nick/visualforce-language-server branch November 14, 2017 00:59
@chowwinston-zz chowwinston-zz deleted the nick/visualforce-language-server branch November 14, 2017 00:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants