File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,8 @@ import { setupStatusBar } from "./statusbar/status";
6
6
import { registerAllCommands } from "./commands" ;
7
7
import { activateLspClient , deactivateLspClient } from "./lsp/client" ;
8
8
import { LanguageClient } from "vscode-languageclient/node" ;
9
+ import { canonicaliseLocation } from "./utils/misc" ;
10
+ import config from "./utils/config" ;
9
11
10
12
// TODO: Don't expose this object directly, create an interface via a wrapper class
11
13
export let client : LanguageClient ;
@@ -34,6 +36,21 @@ export function activate(context: vscode.ExtensionContext) {
34
36
"assets" ,
35
37
"icon.svg" ,
36
38
) ;
39
+
40
+ // TODO: Prompt the user to make this folder the default, and then set back to the config store.
41
+
42
+ // Update user's workspace settings to associate .js to Source
43
+ const workspaceFolder = canonicaliseLocation ( config . workspaceFolder ) ;
44
+ if (
45
+ vscode . workspace . workspaceFolders
46
+ ?. map ( ( wf ) => wf . uri . fsPath )
47
+ . includes ( workspaceFolder )
48
+ ) {
49
+ const workspaceConfig = vscode . workspace . getConfiguration ( ) ;
50
+ workspaceConfig . update ( "files.associations" , {
51
+ "*.js" : "source" ,
52
+ } ) ;
53
+ }
37
54
}
38
55
39
56
// This method is called when your extension is deactivated
Original file line number Diff line number Diff line change @@ -50,7 +50,6 @@ export class Editor {
50
50
self . assessmentName = assessmentName ;
51
51
self . questionId = questionId ;
52
52
53
- // TODO: Prompt the user to make this folder the default, and then set back to the config store.
54
53
const workspaceFolder = canonicaliseLocation ( config . workspaceFolder ) ;
55
54
56
55
const filePath = path . join (
You can’t perform that action at this time.
0 commit comments