diff --git a/building.md b/CONTRIBUTING.md similarity index 95% rename from building.md rename to CONTRIBUTING.md index 5b1237d..9780216 100644 --- a/building.md +++ b/CONTRIBUTING.md @@ -1,11 +1,13 @@ -# Building +# Contributing + +Thank you for considering contributing! ## Regex Engine VSCode uses a regular expressions engine that is based on Ruby for syntax highlighting. [This Rubular site is good site](https://rubular.com/) to test and try out these regular expressions because it uses Ruby which supports `oniguruma` flavor of regular expressions. -## Build Process +## Original Build Process We pretty much followed [these instructions](https://code.visualstudio.com/api/get-started/your-first-extension) for building this extension. And [this link](https://code.visualstudio.com/api/working-with-extensions/publishing-extension) for packaging the extension. @@ -35,6 +37,8 @@ If you have all these tools already installed, you should be able to clone this 8. Go to the output tab 9. In the combo box on the right, choose `Nushell Language Server`. You should now see debug messaging as the client and server communicate +Instead of using VS Code, you can run `npm run compile` manually. + ## Regex Engine TIL - VSCode uses regexes for language syntax highlighting in \*.tmLanguage.json files. Those regexes and json are based on Textmate, which uses (and here is the secret-sauce) `oniguruma` flavor of syntax. See the cheat-sheet for the [syntax here](https://github.com/kkos/oniguruma/blob/master/doc/RE). Also there's a rust-crate called `onig` or `rust-onig` if we wanted to write something to help create compatible regular expressions. diff --git a/src/extension.ts b/src/extension.ts deleted file mode 100644 index b0f8389..0000000 --- a/src/extension.ts +++ /dev/null @@ -1,103 +0,0 @@ -/* eslint-disable @typescript-eslint/no-var-requires */ -// "use strict"; -// import * as vscode from "vscode"; -// export function activate(context: vscode.ExtensionContext) { -// console.log("Terminals: " + (vscode.window).terminals.length); -// context.subscriptions.push( -// vscode.window.registerTerminalProfileProvider("nushell_default", { -// provideTerminalProfile( -// token: vscode.CancellationToken -// ): vscode.ProviderResult { -// const path = require("path"); -// const fs = require("fs"); -// const glob = require("glob"); -// const os = require("os"); - -// const pathsToCheck = [ -// // cargo install location -// "~/.cargo/bin/nu", -// "~/.cargo/bin/nu.exe", - -// // winget on Windows install location -// "c:\\program files\\nu\\bin\\nu.exe", -// // just add a few other drives for fun -// "d:\\program files\\nu\\bin\\nu.exe", -// "e:\\program files\\nu\\bin\\nu.exe", -// "f:\\program files\\nu\\bin\\nu.exe", - -// // SCOOP:TODO -// // all user installed programs and scoop itself install to -// // c:\users\\scoop\ unless SCOOP env var is set -// // globally installed programs go in -// // c:\programdata\scoop unless SCOOP_GLOBAL env var is set -// // scoop install location -// "~/scoop/apps/nu/*/nu.exe", -// "~/scoop/shims/nu.exe", - -// // chocolatey install location - same as winget -// // 'c:\\program files\\nu\\bin\\nu.exe', - -// // macos dmg install -// // we currentl don't have a dmg install - -// // linux and mac zips can be put anywhere so it's hard to guess - -// // brew install location mac -// // intel -// "/usr/local/bin/nu", -// // arm -// "/opt/homebrew/bin/nu", - -// // native package manager install location -// "/usr/bin/nu", -// ]; - -// let found_nushell_path = ""; -// const home = os.homedir(); - -// for (const cur_val of pathsToCheck) { -// // console.log("Inspecting location: " + cur_val); -// let constructed_file = ""; -// if (cur_val.startsWith("~/scoop")) { -// // console.log("Found scoop: " + cur_val); -// const p = path.join(home, cur_val.slice(1)); -// // console.log("Expanded ~: " + p); -// const file = glob.sync(p, "debug").toString(); -// // console.log("Glob for files: " + file); - -// if (file) { -// // console.log("Found some file: " + file); -// // if there are slashes, reverse them to back slashes -// constructed_file = file.replace(/\//g, "\\"); -// } -// } else if (cur_val.startsWith("~")) { -// constructed_file = path.join(home, cur_val.slice(1)); -// // console.log("Found ~, constructing path: " + constructed_file); -// } else { -// constructed_file = cur_val; -// } - -// if (fs.existsSync(constructed_file)) { -// // console.log("File exists, returning: " + constructed_file); -// found_nushell_path = constructed_file; -// break; -// } else { -// // console.log("File not found: " + constructed_file); -// } -// } - -// if (found_nushell_path.length > 0) { -// return { -// options: { -// name: "Nushell", -// shellPath: found_nushell_path, -// }, -// }; -// } else { -// console.log("Nushell not found, returning undefined"); -// return undefined; -// } -// }, -// }) -// ); -// }