-
Notifications
You must be signed in to change notification settings - Fork 29.4k
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
css.experimental.customData #66228
css.experimental.customData #66228
Conversation
dataPaths = []; | ||
} else { | ||
try { | ||
const workspaceRoot = workspace.workspaceFolders[0].uri.fsPath; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Workspace folders can also have other schemes than file:// (in combination with contributed filesystem providers)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I need to handle that. Have never tried custom filesystem providers though. Tracked in #66307.
@@ -30,13 +30,30 @@ export function activate(context: ExtensionContext) { | |||
|
|||
let documentSelector = ['css', 'scss', 'less']; | |||
|
|||
let dataPaths: string[] = workspace.getConfiguration('css').get('experimental.customData', []); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suspect this is just for teting purposes, but I assume in the end, these files will not be located in the workspace but part of a extension, correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They'll, see an example for HTML: https://github.com/octref/web-components-examples
Don't think we can assume everyone wants to publish extensions for enhancing their CSS.
@@ -50,6 +52,8 @@ let scopedSettingsSupport = false; | |||
let foldingRangeLimit = Number.MAX_VALUE; | |||
let workspaceFolders: WorkspaceFolder[]; | |||
|
|||
const languageServices: { [id: string]: LanguageService } = {}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess that's not really a necessary change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doing this so I can locally scope the data variables. I don't want the customData
to be on top level.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So you say vs code can complete css variables by setting this setting
* Licensed under the MIT License. See License.txt in the project root for license information. | ||
*--------------------------------------------------------------------------------------------*/ | ||
|
||
export function parseCSSData(source: string) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd suggest to move that to util
Re the workspace custom data reading, I'll need to redo that for HTML too. Here's the plan:
This will result in project B getting project A's customData, when you have multi workspace setup of Project A and B. But until we change our structure of CSS features to spawn a LS for each workspace folder, this can't be solved. |
For #64164.
Related: microsoft/vscode-css-languageservice#142.