Provides syntax highlighting and use of the Gleam Language Server, which itself provides formatting, goto-definition, autocompletion, and more!
Run npm run compile-watch
in a terminal and hit F5 in vscode.
Contribute to the extension on Github
๐ Gleam support for VS Code
License: Apache License 2.0
Provides syntax highlighting and use of the Gleam Language Server, which itself provides formatting, goto-definition, autocompletion, and more!
Run npm run compile-watch
in a terminal and hit F5 in vscode.
Contribute to the extension on Github
I want build it to vsix so that I can install it from local.
I think it's a good idea to add a npm script for packaging like this:
"scripts": {
"vscode:prepublish": "webpack --mode production",
"compile": "webpack --mode development",
"compile-watch": "webpack --mode development --watch",
"test-compile": "tsc -p ./",
"vscode:package": "vsce package"
},
"devDependencies": {
// ...other
"vsce": "^2.6.7",
// ...other
},
We can use this official example as a guide
I'm getting the following error when trying out the new use
syntax in VSCode:
Syntax error
This operator has no value on its right side.
Hint: Remove it or put a value after it.
I'm running v2.0.0
of the extension.
Windows 10 Home - 22H2
WSL 2 - Debian
I installed Gleam in both the Linux and Windows systems.
For Linux, I installed it via Homebrew (4.2.17) and added /home/linuxbrew/.linuxbrew/bin/gleam
to the $PATH
For Windows, I installed it via Scoop(0.3.1) and added C:\Users\askme\scoop\apps\gleam\current
to the Path
I can confirm via the Debian and Powershell terminal that Gleam is functioning and that I can run my project from both terminals.
Is there something I missed, I only installed Gleam into Windows 10 as I assumed VSCode would be using that and it didn't make a difference. Any help would be appreciated.
The language server does not work for my installation. Gleam 1.0 was installed via asdf
, as described in the gleam docs.
Gleam Language Server VSCode output:
[Error - 11:04:37 AM] Gleam Language Server client: couldn't create connection to server.
Launching server using command gleam failed. Error: spawn gleam ENOENT
Something nice that VS Code does when working with Rust code is continuing the current comment when you press Enter while in the comment.
For example, if we had the following code with our cursor at the end of the /// This is a commnent
line:
/// This is a comment
fn example() {}
Pressing Enter would result in the comment being extended to the next line:
/// This is a comment
///
fn example() {}
From a bit of exploration it seems like we need to do something like this within the extension: https://github.com/rust-lang/rust-analyzer/blob/bc8295255c5bcc293251d47590dcbfd320eaab87/editors/code/src/config.ts#L119-L165
Due to how my environment is set up, the gleam executable is not in $PATH when the gleam extension is loaded, and thus it can not start the language server.
(Path is set in .bashrc which is apparently not loaded)
I think the simplest and/or most general solution would be to add a setting where you can manually specify the path to the gleam executable.
Hi! Having a blast using the theme, albeit in short bursts -- is there any way you could and would be willing to provide a variant with a lighter, more grayish background akin to Nord or sth? The high contrast is unfortunately killing my eyes :)
[Error - 16:36:48] Gleam Language Server client: couldn't create connection to server.
Launching server using command gleam failed. Error: spawn gleam ENOENT
gleam 1.0.0 installed via Homebrew
The server seems to run ok when starting via cli. Am I missing a vscode setting? Is there any way I can debug what it can't find?
unused_non_recursive_func() is highlighted by vs code since it is unused, but unused_recursive_func(flag: Bool) is not highlighted since it is used within itself, which convinces vscode that it is being used. I think this is wrong and that unused_recursive_func(flag: Bool) should be marked as unused.
The same situation but in rust and using the rust-analyzer extension:
Eclipse's Open VSX Registry was created as an alternative to the Visual Studio Marketplace because the latters Terms of Use allow only "Visual Studio Products" access.
Publishing on http://open-vsx.org/ as well would therefore make this available to, amongst others, VSCodium, Onivim and Theia.
See their documentation for how to publish.
The syntax does not highlight binary, octal or hexadecimal integers
Some other VS Code extensions (e.g., rust-analyzer
) have a command to restart the language server:
This can be useful in situations where the language server has gotten out of date somehow and needs a little kick to start working again.
It's currently possible to do this by using the Developer: Reload Window
command, but it would be nice to have a dedicated command for restarting just the language service.
Need to move to the new external attribute for external functions in code snippets
Gleam uses Apache 2.0, but I don't see a license here. Should we use the same one?
Version: v2.7.0
I didn't find any prior issues; I'm also not sure if this is a vscode-gleam
-specific thing or if this should be in https://github.com/gleam-lang/gleam, so sorry in advance.
Hi,
First of all, Gleam is AWESOME and I'm super keen to play with it.
But..
I've installed Gleam following the documentation.
But the LSP doesn't seen to be helping much.
I got code sample from the repo and I was trying to explore the LSP but no luck.
I wonder if I'm still missing something, or this is what I should expect from the current LSP?
When I run this addon I get an error in the extensions output stating:
[Error - 4:40:49 PM] Connection to server is erroring. Shutting down server.
error: Found argument 'lsp' which wasn't expected, or isn't valid in this context
USAGE:
gleam <SUBCOMMAND>
For more information try --help
So maybe it's trying to run some kind old version of gleam that doesn't have the language server command available?
When I just run gleam lsp
on the terminal it works just fine.
Using gleam v1.0.0, with VSCode. Wasn't sure whether to put it here or in the extension repo, so I just put it here.
let _ = 123
let _ = 1_232_312
let _ = 0xFF
let _ = 0xFF_FF
let _ = 0b101101
let _ = 0b101_101
This compiles and runs just fine as expected, but the LSP doesn't seem to recognize the hex and binary with underscores as numeric literals and won't highlight them.
Note that unlike regular numbers, I don't want for these to be automatically formatted (the way normal integers are), as there's no clear way of determining where the separation is supposed to be. I'm currently using these underscores extensively in bitarrays to improve readability of magic bytes in file formats. This issue is just about the highlighting.
hello,
i recently installed this extension along with the gleam language itself. I would like to know how to disable the default formatting command on save, or at least, configure it to use 4 spaces as indentation and do not put a empty newline on the end of the file.
the command npm run compile-watch
returns the fallowing error:
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path [...]/gleam/package.json
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, open '[...]/gleam/package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! /home/mmd/.npm/_logs/2022-09-08T21_27_12_314Z-debug-0.log
any help would be great
My understanding is that this repo also powers the syntax highlighting for GitHub since github-linguist/linguist
points here.
Lots of files in gleam-lang/stdlib
do not highlight properly on GitHub (example, example, example). Here's a small demo:
import gleam/result
import gleam/int
import gleam/list
import gleam/map.{type Map}
import gleam/option.{type Option, None, Some}
import gleam/order
// Internal private representation of an Iterator
type Action(element) {
// Dedicated to Electric Six
// https://youtu.be/_30t2dzEgiw?t=162
Stop
Continue(element, fn() -> Action(element))
}
/// Traverse an iterator, calling a function on each element.
///
/// ```gleam
/// > from_list(["Tom", "Malory", "Louis"]) |> each(io.println)
/// // -> Tom
/// // -> Malory
/// // -> Louis
/// Nil
/// ```
///
pub fn yield(element: a, next: fn() -> Iterator(a)) -> Iterator(a) {
Iterator(fn() { Continue(element, next().continuation) })
}
In every example, the issue seems to be related to the import a/b.{type c}
syntax.
A similar (though less severe) issue for the Dart language seems related. It's unclear if this is a bug in this repo, in GitHub's highlighting, or in VSCode's highlighting.
First of all, I think Gleam and its ecosystem have potential.
Wonderful work!
I tried to use VSCode Gleam with a mix_gleam project.
It looks like type inferences and real-time syntax error checking are not working.
However, the gleam compilation with mix is ok.
Thank you.
Currently this has no code. Add the required components to have further functionality written in TypeScript.
Hello!
Just noticed that the VSCode Marketplace says that the latest version is v1.3.0, but I only see v1.2.0 here. Which is correct?
Thanks,
Oliver
I gave Gleam a shot, and I love the language itself and the overall vibe around it. I found the LSP lacking, but that was to be expected, and I'm looking forward to seeing this develop.
Is there a roadmap someplace to see what's planned for this?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.