Skip to content

Commit

Permalink
update readme (#109)
Browse files Browse the repository at this point in the history
  • Loading branch information
fdncred authored Apr 18, 2023
1 parent da640d5 commit 8a0c0f0
Show file tree
Hide file tree
Showing 17 changed files with 52 additions and 21 deletions.
9 changes: 5 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,13 @@ All notable changes to the "vscode-nushell-lang" extension will be documented in

## Release

- 1.2.0
- 1.5.0
- No longer a preview release
- Fix `use` coloring when used in variable naming
- Allow underscore separators in numbers
- Goto Definition
- Inlays
- Inlays / Hints
- Hover
- Error squigglys
- Autocomplete
- Settings to help with LSP-like features
- Auto-complete
- Editor IDE Settings to help configure some features
42 changes: 36 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,53 @@
[![vsm-downloads](https://img.shields.io/visual-studio-marketplace/d/TheNuProjectContributors.vscode-nushell-lang?style=flat-square&label=downloads&logo=visual-studio-code)](https://marketplace.visualstudio.com/items?itemName=TheNuProjectContributors.vscode-nushell-lang)
[![vsm-installs](https://img.shields.io/visual-studio-marketplace/i/TheNuProjectContributors.vscode-nushell-lang?style=flat-square&label=installs&logo=visual-studio-code)](https://marketplace.visualstudio.com/items?itemName=TheNuProjectContributors.vscode-nushell-lang)


This [extension for VSCode](https://code.visualstudio.com/docs/introvideos/extend) provides editing and syntax highlighting support for [Nushell](http://nushell.sh), a data-driven document language.
This [extension for VSCode](https://code.visualstudio.com/docs/introvideos/extend) provides editing, syntax highlighting, and IDE support for [Nushell](http://nushell.sh), a data-driven document language.

## Features

- Syntax highlighting grammar for Nushell scripts (`.nu` files)
- Nushell theme that tries to match Nushell's coloring
- Goto definition
- Hover support
- Validation (errors with red squiggly lines)
- Auto-complete built-in commands
- Inlays / Hints
- Configuration via vscode settings

## Screenshot (v1.0.0)
## Screenshot (v1.5.0)

With Dark+ Color Theme

![Nushell script with Dark+ color theme](https://raw.githubusercontent.com/nushell/vscode-nushell-lang/main/assets/100-dark.png)
![Nushell script with Dark+ color theme](https://raw.githubusercontent.com/nushell/vscode-nushell-lang/main/assets/150-dark.png)

With Light+ Color Theme

![Nushell script with Light+ color theme](https://raw.githubusercontent.com/nushell/vscode-nushell-lang/main/assets/100-light.png)
![Nushell script with Light+ color theme](https://raw.githubusercontent.com/nushell/vscode-nushell-lang/main/assets/150-light.png)

Inlays / Hints
![Inlays](https://raw.githubusercontent.com/nushell/vscode-nushell-lang/main/assets/150-inlays.png)

Completions support
![Completions](https://raw.githubusercontent.com/nushell/vscode-nushell-lang/main/assets/150-completions.png)

Hover over built-ins for help
![Hover](https://raw.githubusercontent.com/nushell/vscode-nushell-lang/main/assets/150-hover-builtin.png)

Hover over custom commands for help
![HoverCustom](https://raw.githubusercontent.com/nushell/vscode-nushell-lang/main/assets/150-hover-custom.png)

Hover over variable
![HoverVar](https://raw.githubusercontent.com/nushell/vscode-nushell-lang/main/assets/150-hover-var.png))

Error & Validation support
![Error 1](https://raw.githubusercontent.com/nushell/vscode-nushell-lang/main/assets/150-error1.png)
![Error 2](https://raw.githubusercontent.com/nushell/vscode-nushell-lang/main/assets/150-error2.png)
![Error 3](https://raw.githubusercontent.com/nushell/vscode-nushell-lang/main/assets/150-error3.png)

Goto Definition support
![goto](https://raw.githubusercontent.com/nushell/vscode-nushell-lang/main/assets/150-goto-def.png)

Extension Settings
![settings](https://raw.githubusercontent.com/nushell/vscode-nushell-lang/main/assets/150-ext-settings.png)

## Known Issues

Expand Down
Binary file added assets/150-completions.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/150-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/150-errors1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/150-errors2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/150-errors3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/150-ext-settings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/150-goto-def.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/150-hover-builtin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/150-hover-custom.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/150-hover-var.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/150-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/150_inlays.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions building.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ If you have all these tools already installed, you should be able to clone this
2. In repo folder `npm install`
3. Hit F5 to start debugging (or Run->Start Debugging menu item)
4. Go to settings with `Ctrl ,` or `Cmd ,`
5. In the settings tree on the left, go to Extensions->Nushell LSP and make sure `Nushell Executable Path` is pointing at where you have nu/nu.exe installed. (It must be version 0.78.1 or greater)
5. In the settings tree on the left, go to Extensions->Nushell IDE Support and make sure `Nushell Executable Path` is pointing at where you have nu/nu.exe installed. (It must be version 0.79.0 or greater)
6. Open a nushell script and in a moment you should see inlays and see the full functionality
7. To see the Language Server debug messages hit `Ctrl ~`
8. Go to the output tab
9. In the combo box on the right, choose `Nushell Language Server`. You should now see debug messaging when you use any of the LSP functionality
9. In the combo box on the right, choose `Nushell Language Server`. You should now see debug messaging as the client and server communicate

## Regex Engine

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"displayName": "vscode-nushell-lang",
"description": "nushell language for vscode",
"author": "The Nushell Project Developers",
"version": "1.2.0",
"version": "1.5.0",
"preview": false,
"license": "MIT",
"publisher": "TheNuProjectContributors",
Expand Down Expand Up @@ -82,7 +82,7 @@
},
"configuration": {
"type": "object",
"title": "Nushell LSP",
"title": "Nushell IDE Support",
"properties": {
"nushellLanguageServer.maxNumberOfProblems": {
"scope": "resource",
Expand Down
14 changes: 7 additions & 7 deletions server/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ connection.onInitialized(() => {
});

// The nushell settings
interface NushellLSPSettings {
interface NushellIDESettings {
maxNumberOfProblems: number;
hints: {
showInferredTypes: boolean;
Expand All @@ -154,24 +154,24 @@ interface NushellLSPSettings {
// The global settings, used when the `workspace/configuration` request is not supported by the client.
// Please note that this is not the case when using this server with the client provided in this example
// but could happen with other clients.
const defaultSettings: NushellLSPSettings = {
const defaultSettings: NushellIDESettings = {
maxNumberOfProblems: 1000,
hints: { showInferredTypes: true },
nushellExecutablePath: "nu",
maxNushellInvocationTime: 10000000,
includeDirs: [],
};
let globalSettings: NushellLSPSettings = defaultSettings;
let globalSettings: NushellIDESettings = defaultSettings;

// Cache the settings of all open documents
const documentSettings: Map<string, Thenable<NushellLSPSettings>> = new Map();
const documentSettings: Map<string, Thenable<NushellIDESettings>> = new Map();

connection.onDidChangeConfiguration((change) => {
if (hasConfigurationCapability) {
// Reset all cached document settings
documentSettings.clear();
} else {
globalSettings = <NushellLSPSettings>(
globalSettings = <NushellIDESettings>(
(change.settings.nushellLanguageServer || defaultSettings)
);
}
Expand All @@ -180,7 +180,7 @@ connection.onDidChangeConfiguration((change) => {
documents.all().forEach(validateTextDocument);
});

function getDocumentSettings(resource: string): Thenable<NushellLSPSettings> {
function getDocumentSettings(resource: string): Thenable<NushellIDESettings> {
if (!hasConfigurationCapability) {
return Promise.resolve(globalSettings);
}
Expand Down Expand Up @@ -395,7 +395,7 @@ function convertPosition(position: Position, text: string): number {
async function runCompiler(
text: string, // this is the script or the snippet of nushell code
flags: string,
settings: NushellLSPSettings,
settings: NushellIDESettings,
uri: string,
options: { allowErrors?: boolean } = {}
): Promise<string> {
Expand Down

0 comments on commit 8a0c0f0

Please sign in to comment.