-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: first pass + general cleanup * refactor: allow toggle of output channel vs terminal * fix: delete dummy code
- Loading branch information
Showing
11 changed files
with
230 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,24 @@ | ||
{ | ||
// Disable bracket colorization for testing | ||
"editor.bracketPairColorization.enabled": false, | ||
// Disable comment colorization for testing | ||
"better-comments.tags": [], | ||
"files.exclude": { | ||
"dist": false, | ||
"out": false | ||
}, | ||
// Disable comment colorization for testing | ||
"better-comments.tags": [], | ||
|
||
"search.exclude": { | ||
"yarn.lock": true | ||
}, | ||
"search.useIgnoreFiles": true, | ||
"editor.codeActionsOnSave": { | ||
"source.fixAll.eslint": "explicit", | ||
"source.fixAll.prettier": "explicit" | ||
}, | ||
// Turn off tsc task auto detection since we have the necessary tasks as npm scripts | ||
"typescript.tsc.autoDetect": "off", | ||
"eslint.useFlatConfig": true, | ||
"search.useIgnoreFiles": true | ||
// have eslint auto sort imports | ||
"eslint.format.enable": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,11 @@ | ||
export const EXTENSION_NAME = 'vscode-just'; | ||
export const COMMANDS = { | ||
formatDocument: `${EXTENSION_NAME}.formatDocument`, | ||
runRecipe: `${EXTENSION_NAME}.runRecipe`, | ||
}; | ||
export const SETTINGS = { | ||
justPath: 'justPath', | ||
formatOnSave: 'formatOnSave', | ||
runInTerminal: 'runInTerminal', | ||
logLevel: 'logLevel', | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import * as vscode from 'vscode'; | ||
|
||
import { workspaceRoot } from './utils'; | ||
|
||
let LAUNCHER: Launcher; | ||
|
||
class Launcher implements vscode.Disposable { | ||
private terminals: Set<vscode.Terminal>; | ||
|
||
private onTerminalClose = vscode.window.onDidCloseTerminal((terminal) => { | ||
if (this.terminals.has(terminal)) { | ||
this.terminals.delete(terminal); | ||
} | ||
}); | ||
|
||
constructor() { | ||
this.terminals = new Set(); | ||
} | ||
|
||
public launch(command: string, args: string[]) { | ||
const terminalOptions: vscode.TerminalOptions = { | ||
name: command, | ||
env: process.env, | ||
cwd: workspaceRoot(), | ||
}; | ||
|
||
// Copied from Makefile launcher: | ||
// https://github.com/microsoft/vscode-makefile-tools/blob/36a51746d263b6fc4a9054924c388d2c8a49ee1b/src/launch.ts#L445 | ||
if (process.platform === 'win32') { | ||
terminalOptions.shellPath = 'C:\\Windows\\System32\\cmd.exe'; | ||
} | ||
|
||
const terminal = vscode.window.createTerminal(terminalOptions); | ||
this.terminals.add(terminal); | ||
|
||
terminal.sendText(`${command} ${args.join(' ')}`); | ||
terminal.show(); | ||
|
||
return terminal; | ||
} | ||
|
||
public dispose() { | ||
this.terminals.forEach((terminal) => terminal.dispose()); | ||
this.terminals.clear(); | ||
this.onTerminalClose.dispose(); | ||
} | ||
} | ||
|
||
export const getLauncher = () => { | ||
if (!LAUNCHER) { | ||
LAUNCHER = new Launcher(); | ||
} | ||
return LAUNCHER; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.