Skip to content
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

Some support for TOML files #4503

Merged
merged 11 commits into from
Aug 22, 2022
Merged

Some support for TOML files #4503

merged 11 commits into from
Aug 22, 2022

Conversation

lkishalmi
Copy link
Contributor

This support provides the following:

  • lexer based syntax coloring
  • useful keybindings
  • some code completion based on the keys in the current document.

image

@lkishalmi lkishalmi added this to the NB16 milestone Aug 14, 2022
@lkishalmi lkishalmi requested review from mbien and sdedic August 14, 2022 23:23
Copy link
Member

@mbien mbien left a comment

Choose a reason for hiding this comment

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

awesome! We should use this PR as an up2date example of writing a language support module.

I quickly looked through it as first pass (no real review) and added two minor comments inline. Good job!

I think it would be good to have at least a basic "black box" test for this which parses a file and checks that nothing explodes.

@lkishalmi
Copy link
Contributor Author

As of tests, I still need to study the Yaml language support how to write them. There could be some edge cases in the keyboard handling and the code completion.

@Chris2011
Copy link
Contributor

Great work, will help me also to extend other languages and add more :)

ide/languages.toml/nbproject/project.properties Outdated Show resolved Hide resolved
TokenHierarchy th = TokenHierarchy.get(doc);
TokenSequence<TomlTokenId> ts = th.tokenSequence();
ts.move(offset);
ts.movePrevious();
Copy link
Member

Choose a reason for hiding this comment

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

Maybe check the result of movePrevious; indicates end(begin)-of-token stream

@lkishalmi lkishalmi marked this pull request as draft August 16, 2022 00:50
@lkishalmi lkishalmi marked this pull request as ready for review August 21, 2022 19:31
@lkishalmi lkishalmi merged commit 7daf641 into apache:master Aug 22, 2022
Chris2011 pushed a commit to Chris2011/netbeans that referenced this pull request Dec 15, 2022
* Add tomlj library.

* Added support for TOML Lexer

* Added a few useful keystrokes for TOML

* Added transparent backround to the TOML icon.

* Added a simple TOML completion provider

* Enabled TOML formatting options

* Adjusted TOML Syntax Coloring

* Remove some cruft on TOML Support

* Polishing TOML Support

* Added TOML Support to Editor Kit as dependency

* Added some testing for TOML
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants