Skip to content

runtime(gleam): add syntax and compiler and update ftplugin #17172

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from

Conversation

kirillmorozov
Copy link
Contributor

With @lpil's approval I decided to incorporate syntax, ftplugin and compiler from the official Gleam Vim plugin into the Vim repo.

I've made the following changes to the files in the process:

  • syntax: Make syntax case sensitive, link keywords to suggested group names, highlight documentation comments as special comments, improve matching of numbers with _ separator.
  • compiler: Add parsing of warning messages.
  • ftplugin: Remove multiline options from comments because they do not exist in Gleam and remove textwidth option.

Related-to: gleam-lang/gleam.vim#15
Signed-off-by: Kirill Morozov kirill@robotix.pro

Copy link

@lpil lpil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lovely, thank you! Two questions inline from me

@kirillmorozov kirillmorozov force-pushed the master branch 2 times, most recently from 3f352b7 to becf330 Compare April 20, 2025 20:14
" Vim compiler file
" Language: Gleam
" Maintainer: Kirill Morozov <kirill@robotix.pro>
" Based On: https://github.com/gleam-lang/gleam.vim
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this going to be the upstream repo? If so, the comment title is usually URL: .

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, it's going to be deprecated.

" Language: Gleam
" Maintainer: Kirill Morozov <kirill@robotix.pro>
" Based On: https://github.com/gleam-lang/gleam.vim
" Last Change: 2025-04-20
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
" Last Change: 2025-04-20
" Last Change: 2025 Apr 20

I know there's multiple formats but this is the gold standard.

CompilerSet errorformat=%Eerror:\ %m
CompilerSet errorformat+=%Wwarning:\ %m
CompilerSet errorformat+=%C\ %#┌─%#\ %f:%l:%c\ %#-%#

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The efm lines need to be separated with ,


if !exists('current_compiler')
compiler gleam
let b:undo_ftplugin .= "| compiler make"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
let b:undo_ftplugin .= "| compiler make"
let b:undo_ftplugin ..= "| compiler make"

We should really be using .. everywhere.

kirillmorozov and others added 5 commits April 22, 2025 20:41
Signed-off-by: Kirill Morozov <kirill@robotix.pro>
Signed-off-by: Kirill Morozov <kirill@robotix.pro>
Signed-off-by: Kirill Morozov <kirill@robotix.pro>
Signed-off-by: Kirill Morozov <kirill@robotix.pro>
Copy link
Contributor

@dkearns dkearns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.

@chrisbra
Copy link
Member

alright, thanks all

@chrisbra chrisbra closed this in 32f4973 Apr 24, 2025
clason added a commit to clason/neovim that referenced this pull request Apr 25, 2025
…w compiler and syntax script

closes: vim/vim#17172

vim/vim@32f4973

Co-authored-by: Kirill Morozov <mail2kirill@gmail.com>
clason added a commit to neovim/neovim that referenced this pull request Apr 25, 2025
…w compiler and syntax script

closes: vim/vim#17172

vim/vim@32f4973

Co-authored-by: Kirill Morozov <mail2kirill@gmail.com>
brynne8 pushed a commit to brynne8/neovim that referenced this pull request Apr 25, 2025
…w compiler and syntax script

closes: vim/vim#17172

vim/vim@32f4973

Co-authored-by: Kirill Morozov <mail2kirill@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants