Skip to content

Commit

Permalink
Combine custom snippets from base syntax #29146
Browse files Browse the repository at this point in the history
  • Loading branch information
ramya-rao-a committed Jul 19, 2017
1 parent 79280bd commit 5fb80bb
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 18 deletions.
6 changes: 3 additions & 3 deletions extensions/emmet/npm-shrinkwrap.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion extensions/emmet/package.json
Expand Up @@ -73,7 +73,7 @@
"@emmetio/html-matcher": "^0.3.1",
"@emmetio/css-parser": "^0.3.0",
"@emmetio/math-expression": "^0.1.1",
"vscode-emmet-helper":"0.0.24",
"vscode-emmet-helper":"0.0.25",
"vscode-languageserver-types": "^3.0.3"
}
}
26 changes: 12 additions & 14 deletions extensions/emmet/src/extension.ts
Expand Up @@ -119,24 +119,22 @@ export function activate(context: vscode.ExtensionContext) {
incrementDecrement(-10);
}));


let extensionsPath = vscode.workspace.getConfiguration('emmet')['extensionsPath'];
if (extensionsPath) {
if (!path.isAbsolute(extensionsPath)) {
let currentExtensionsPath = undefined;
let resolveUpdateExtensionsPath = () => {
let extensionsPath = vscode.workspace.getConfiguration('emmet')['extensionsPath'];
if (extensionsPath && !path.isAbsolute(extensionsPath)) {
extensionsPath = path.join(vscode.workspace.rootPath, extensionsPath);
}
updateExtensionsPath(extensionsPath);
}
if (currentExtensionsPath !== extensionsPath) {
currentExtensionsPath = extensionsPath;
updateExtensionsPath(currentExtensionsPath);
}
};

resolveUpdateExtensionsPath();

context.subscriptions.push(vscode.workspace.onDidChangeConfiguration(() => {
let newExtensionsPath = vscode.workspace.getConfiguration('emmet')['extensionsPath'];
if (newExtensionsPath && !path.isAbsolute(newExtensionsPath)) {
newExtensionsPath = path.join(vscode.workspace.rootPath, newExtensionsPath);
}
if (extensionsPath !== newExtensionsPath) {
updateExtensionsPath(newExtensionsPath);
extensionsPath = newExtensionsPath;
}
resolveUpdateExtensionsPath();
}));
}

Expand Down

0 comments on commit 5fb80bb

Please sign in to comment.