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

css.experimental.customData #66228

Merged
merged 5 commits into from
Jan 11, 2019
Merged

css.experimental.customData #66228

merged 5 commits into from
Jan 11, 2019

Conversation

octref
Copy link
Contributor

@octref octref commented Jan 8, 2019

dataPaths = [];
} else {
try {
const workspaceRoot = workspace.workspaceFolders[0].uri.fsPath;
Copy link
Contributor

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)

Copy link
Contributor Author

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', []);
Copy link
Contributor

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?

Copy link
Contributor Author

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 } = {};
Copy link
Contributor

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.

Copy link
Contributor Author

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.

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) {
Copy link
Contributor

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

@octref
Copy link
Contributor Author

octref commented Jan 9, 2019

Re the workspace custom data reading, I'll need to redo that for HTML too. Here's the plan:

  • Loop through each workspace folder
  • Add customData from each

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.

@octref octref merged commit 3e8028e into master Jan 11, 2019
@octref octref deleted the octref/customCSSData branch January 16, 2019 17:57
@github-actions github-actions bot locked and limited conversation to collaborators Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants