Skip to content

Commit

Permalink
Vscode client (#21)
Browse files Browse the repository at this point in the history
* Added vscode client

* Fixed arguments on functions calls

* Some refactors and fixed vectors not working properly

* Fixed all related stuff with vectors

* Updated TODO

* Updated TODO

* Fixed string literal failing

* Fixed string literals not getting the first char correctly

* Now parses functions calls with default arguments correctly

* Fixed functions definitions not getting the inside statements

* Added missing types and added arguments of func defs

* Added args completion for function calls

* Version 2.1.0 ready, fixed big issues and added some important features like completion

* Publishing the extension for the first time

* Updated TODO

* Added command to publish extension

* Added missing dependency vscode-languageserver

* Changed version

---------

Co-authored-by: Tomás Vidal <[email protected]>
  • Loading branch information
TomiVidal99 and Tomás Vidal authored Oct 28, 2023
1 parent 3d50dce commit 50e8de2
Show file tree
Hide file tree
Showing 18 changed files with 11,560 additions and 1,278 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ This is an implementation of the [Language Server Protocol](https://code.visuals

## Working features

- Completion _(some keywords, some native functions, user defined functions and files)_
- goToDefinition _(for user defined functions)_
- Completion _(some keywords, some native functions, user defined functions with default arguments (atm))_
- goToDefinition _(for user defined functions in the same file (atm))_
- goToReference
- diagnostics _(closing tags, typing errors)_
- diagnostics _(closing tags, basic typing errors)_

## How to setup in the client

Expand Down Expand Up @@ -49,17 +49,17 @@ end

## TODO

- [ ] FIX: consider string vectors: ["a", "b"]
- [ ] ADD: STRUCTS '{}'.
- [ ] FIX: consider keywords like global.
- [ ] FIX: multiple calls freezes the server.
- [ ] FIX: KEYWORDS are not native functions.
- [ ] FIX: functions with no parenthesis are not getting recognized.
- [ ] FIX: '\n' inside strings breaks the getRowsAndCols function.
- [ ] ADD: diagnostics for: redefined functions, missing imports.
- [ ] ADD: references to files.
- [ ] ADD: consider default values of functions definitions.
- [ ] ADD: block comments.
- [ ] ADD: replace error throws with linting messages.
- [ ] ADD: linting errors and warnings.
- [ ] ADD: make parser tests.
- [ ] ADD: Maybe consider documentation with comments on variable as well.
- [ ] ADD: CI/CD.
- [ ] FEATURES?: Maybe have a user setting to be able to multiple variables and functions definitions, instead of grabbing the first one?


Expand Down
21 changes: 21 additions & 0 deletions client/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 Tomás Vidal

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
142 changes: 71 additions & 71 deletions client/README.md
Original file line number Diff line number Diff line change
@@ -1,71 +1,71 @@
# mlang README

This is the README for your extension "mlang". After writing up a brief description, we recommend including the following sections.

## Features

Describe specific features of your extension including screenshots of your extension in action. Image paths are relative to this README file.

For example if there is an image subfolder under your extension project workspace:

\!\[feature X\]\(images/feature-x.png\)

> Tip: Many popular extensions utilize animations. This is an excellent way to show off your extension! We recommend short, focused animations that are easy to follow.
## Requirements

If you have any requirements or dependencies, add a section describing those and how to install and configure them.

## Extension Settings

Include if your extension adds any VS Code settings through the `contributes.configuration` extension point.

For example:

This extension contributes the following settings:

* `myExtension.enable`: Enable/disable this extension.
* `myExtension.thing`: Set to `blah` to do something.

## Known Issues

Calling out known issues can help limit users opening duplicate issues against your extension.

## Release Notes

Users appreciate release notes as you update your extension.

### 1.0.0

Initial release of ...

### 1.0.1

Fixed issue #.

### 1.1.0

Added features X, Y, and Z.

---

## Following extension guidelines

Ensure that you've read through the extensions guidelines and follow the best practices for creating your extension.

* [Extension Guidelines](https://code.visualstudio.com/api/references/extension-guidelines)

## Working with Markdown

You can author your README using Visual Studio Code. Here are some useful editor keyboard shortcuts:

* Split the editor (`Cmd+\` on macOS or `Ctrl+\` on Windows and Linux).
* Toggle preview (`Shift+Cmd+V` on macOS or `Shift+Ctrl+V` on Windows and Linux).
* Press `Ctrl+Space` (Windows, Linux, macOS) to see a list of Markdown snippets.

## For more information

* [Visual Studio Code's Markdown Support](http://code.visualstudio.com/docs/languages/markdown)
* [Markdown Syntax Reference](https://help.github.com/articles/markdown-basics/)

**Enjoy!**
# mlang

Client for the mlang LSP

<!-- ## Features -->
<!---->
<!-- Describe specific features of your extension including screenshots of your extension in action. Image paths are relative to this README file. -->
<!---->
<!-- For example if there is an image subfolder under your extension project workspace: -->
<!---->
<!-- \!\[feature X\]\(images/feature-x.png\) -->
<!---->
<!-- > Tip: Many popular extensions utilize animations. This is an excellent way to show off your extension! We recommend short, focused animations that are easy to follow. -->
<!---->
<!-- ## Requirements -->
<!---->
<!-- If you have any requirements or dependencies, add a section describing those and how to install and configure them. -->
<!---->
<!-- ## Extension Settings -->
<!---->
<!-- Include if your extension adds any VS Code settings through the `contributes.configuration` extension point. -->
<!---->
<!-- For example: -->
<!---->
<!-- This extension contributes the following settings: -->
<!---->
<!-- * `myExtension.enable`: Enable/disable this extension. -->
<!-- * `myExtension.thing`: Set to `blah` to do something. -->
<!---->
<!-- ## Known Issues -->
<!---->
<!-- Calling out known issues can help limit users opening duplicate issues against your extension. -->
<!---->
<!-- ## Release Notes -->
<!---->
<!-- Users appreciate release notes as you update your extension. -->
<!---->
<!-- ### 1.0.0 -->
<!---->
<!-- Initial release of ... -->
<!---->
<!-- ### 1.0.1 -->
<!---->
<!-- Fixed issue #. -->
<!---->
<!-- ### 1.1.0 -->
<!---->
<!-- Added features X, Y, and Z. -->
<!---->
<!-- --- -->
<!---->
<!-- ## Following extension guidelines -->
<!---->
<!-- Ensure that you've read through the extensions guidelines and follow the best practices for creating your extension. -->
<!---->
<!-- * [Extension Guidelines](https://code.visualstudio.com/api/references/extension-guidelines) -->
<!---->
<!-- ## Working with Markdown -->
<!---->
<!-- You can author your README using Visual Studio Code. Here are some useful editor keyboard shortcuts: -->
<!---->
<!-- * Split the editor (`Cmd+\` on macOS or `Ctrl+\` on Windows and Linux). -->
<!-- * Toggle preview (`Shift+Cmd+V` on macOS or `Shift+Ctrl+V` on Windows and Linux). -->
<!-- * Press `Ctrl+Space` (Windows, Linux, macOS) to see a list of Markdown snippets. -->
<!---->
<!-- ## For more information -->
<!---->
<!-- * [Visual Studio Code's Markdown Support](http://code.visualstudio.com/docs/languages/markdown) -->
<!-- * [Markdown Syntax Reference](https://help.github.com/articles/markdown-basics/) -->
<!---->
<!-- **Enjoy!** -->
16 changes: 9 additions & 7 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@
"name": "mlang",
"displayName": "mlang",
"description": "Octave/Matlab Language Server",
"version": "0.0.1",
"version": "1.0.2",
"repository": "https://github.com/TomiVidal99/mlang",
"publisher": "mlang",
"engines": {
"vscode": "^1.83.0"
},
"categories": [
"LSP"
],
"activationEvents": [
"onLanguage:octave",
"onLanguage:matlab",
Expand Down Expand Up @@ -40,15 +39,18 @@
"test": "node ./out/test/runTest.js"
},
"devDependencies": {
"@types/vscode": "^1.83.0",
"@types/mocha": "^10.0.2",
"@types/node": "18.x",
"@types/vscode": "^1.83.0",
"@typescript-eslint/eslint-plugin": "^6.7.3",
"@typescript-eslint/parser": "^6.7.3",
"@vscode/test-electron": "^2.3.4",
"eslint": "^8.50.0",
"glob": "^10.3.3",
"mocha": "^10.2.0",
"typescript": "^5.2.2",
"@vscode/test-electron": "^2.3.4"
"typescript": "^5.2.2"
},
"dependencies": {
"vscode-languageclient": "^9.0.1"
}
}
Loading

0 comments on commit 50e8de2

Please sign in to comment.