Skip to content

Commit c46ac97

Browse files
committed
工作区设置
1 parent 39e629c commit c46ac97

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

client/out/languageserver.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/out/patch.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ function patchMarkdown() {
1616
code.MarkdownString = patchedMarkdownString;
1717
}
1818

19-
function patch(client) {
19+
function patch() {
2020
patchMarkdown();
2121
}
2222

client/src/languageserver.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
commands as Commands,
99
TextDocument,
1010
WorkspaceFolder,
11-
Uri
11+
Uri,
1212
} from 'vscode';
1313
import {
1414
LanguageClient,
@@ -24,7 +24,7 @@ let clients: Map<string, LanguageClient> = new Map();
2424

2525
function registerCustomCommands(context: ExtensionContext) {
2626
context.subscriptions.push(Commands.registerCommand('lua.config', (data) => {
27-
let config = Workspace.getConfiguration()
27+
let config = Workspace.getConfiguration(undefined, Uri.parse(data.uri))
2828
if (data.action == 'add') {
2929
let value: any[] = config.get(data.key);
3030
value.push(data.value);
@@ -143,16 +143,14 @@ function start(context: ExtensionContext, documentSelector: DocumentSelector, fo
143143
);
144144

145145
client.registerProposedFeatures();
146-
147-
patch.patch(client);
148-
149146
client.start();
150147

151148
return client;
152149
}
153150

154151
export function activate(context: ExtensionContext) {
155152
registerCustomCommands(context);
153+
patch.patch();
156154
function didOpenTextDocument(document: TextDocument): void {
157155
// We are only interested in language mode text
158156
if (document.languageId !== 'lua' || (document.uri.scheme !== 'file' && document.uri.scheme !== 'untitled')) {
@@ -188,7 +186,7 @@ export function activate(context: ExtensionContext) {
188186
Workspace.onDidOpenTextDocument(didOpenTextDocument);
189187
Workspace.textDocuments.forEach(didOpenTextDocument);
190188
Workspace.onDidChangeWorkspaceFolders((event) => {
191-
for (let folder of event.removed) {
189+
for (let folder of event.removed) {
192190
let client = clients.get(folder.uri.toString());
193191
if (client) {
194192
clients.delete(folder.uri.toString());

0 commit comments

Comments
 (0)