Skip to content

Various fixes and improvements #70

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

Open
wants to merge 43 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
a910ae8
dev: initial Nix dev environment spec
igordejanovic Apr 30, 2025
e7593b6
dev: task esbuild watcher problem matcher
igordejanovic Apr 30, 2025
dad7424
dev: cannot use VS Code extensions from flake
igordejanovic Apr 30, 2025
ef43ae0
fix: add lsprotocol server dependency
igordejanovic Apr 30, 2025
a8110c6
dev: add debug adapter and protocol
igordejanovic Apr 30, 2025
a6f7d6b
fix: use env variable used by ms-python extension
igordejanovic May 3, 2025
376962b
chn: remove extension venv
igordejanovic May 4, 2025
d0cfea5
dev: extension recommendation update
igordejanovic May 4, 2025
3c4e802
fix: race condition on activation
igordejanovic May 4, 2025
9db2450
fix: show the cause of installation failure
igordejanovic May 4, 2025
b2758bb
chn: better Python interpreter choosing
igordejanovic May 4, 2025
ecb2306
chn: moved to pyproject.toml
igordejanovic May 4, 2025
9d1b230
add: support for pyproject.toml
igordejanovic May 4, 2025
c0d0789
dev: print python path
igordejanovic May 4, 2025
f55823a
fix: install textx-gen-vscode from extension
igordejanovic May 4, 2025
dc24130
dev: move to Python 3.12 in flake
igordejanovic May 4, 2025
62fd811
dev: add vsce to flake
igordejanovic May 4, 2025
cf4bcf5
chore: update README
igordejanovic May 4, 2025
ba23e3d
chn+fix: changed dynamic syntax highlighing approach
igordejanovic May 6, 2025
ef6501a
fix: refresh documents on extension load
igordejanovic May 6, 2025
2429287
chn: remove vsix ext. generating
igordejanovic May 6, 2025
e72eb16
dev: move python req. to flake
igordejanovic May 6, 2025
033df02
chn: drop dependency to setuptools pkg_resources
igordejanovic May 6, 2025
3a95086
dev: add flit to flake
igordejanovic May 6, 2025
3cd10b1
fix: handling of decoration update
igordejanovic May 6, 2025
bb20f38
rfc: small optimization
igordejanovic May 6, 2025
954c1ec
try: dynamic lang registration - not working
igordejanovic May 6, 2025
3755c68
Revert "try: dynamic lang registration - not working"
igordejanovic May 6, 2025
dcf1868
Revert "chn: remove vsix ext. generating"
igordejanovic May 6, 2025
e1cf420
fix: do not swallow exceptions during install
igordejanovic May 6, 2025
1b47485
chore: dev package versions
igordejanovic May 6, 2025
b3d40dc
chn: more robust LSP server connection handling
igordejanovic May 6, 2025
6e03eb5
add: LSP server restart on client close
igordejanovic May 7, 2025
24bf89c
chore: add vscode-extensions folder to gitignore
igordejanovic May 7, 2025
02dd62c
chn: remove vsce handling in client
igordejanovic May 8, 2025
cc72019
chn: improve IO LSP communication
igordejanovic May 8, 2025
616da7c
fix: install gen-coloring from client
igordejanovic May 8, 2025
751a4eb
chn: move LSP server cli to logging
igordejanovic May 8, 2025
d45dab6
add: make_package.sh script
igordejanovic May 8, 2025
413a2b6
fix: build scripts
igordejanovic May 9, 2025
6d2cdda
doc: update README
igordejanovic May 9, 2025
7608fb5
Version 0.3.0
igordejanovic May 9, 2025
e0ad85d
fix: install of required Python packages
igordejanovic May 10, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use flake
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -111,4 +111,8 @@ venv.bak/
# mypy
.mypy_cache/

.DS_Store
.DS_Store
/.direnv/

# VS Code extensions
/vscode-extensions
7 changes: 7 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"recommendations": [
"ms-python.python",
"ms-python.debugpy",
"connor4312.esbuild-problem-matchers"
]
}
26 changes: 26 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,32 @@ and this project adheres to [Semantic Versioning][semver].

## [unreleased]

## [0.3.0] (released 2025-05-09)

### Added
- dev: debug adapter and protocol

### Changed
- Use Nix flake for creating development setup.
- User virtual env is used for client VS Code extension so it can be interacted
with from the CLI easily.
- Python is searched in user virtual env (env variable VIRUAL_ENV) or using
setup from MS Python extension.
- Moved to pyproject.toml
- dropped dependency to setuptools pkg_resources
- use flit for build
- moved to logging module for server and deps
- Removed dependency to vsce (change in textx-gen-vscode)
- improved dynamic syntax highlighting
- more robust LSP server connection handling
- LSP server restarts on client close
- improved IO LSP communication

### Fixed
- added lsprotocol server dependency
- race condition on activation
- better error reporting on installation failure and other errors

## [0.1.2] (released 12/30/2019)

### Fixed
Expand Down
37 changes: 28 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ and a _Visual Studio Code_ extension:

- _[client](https://github.com/textX/textX-LS/tree/master/client)_

## :warning: This project got a new maintainer

After several years of inactivity this project is in a transition to a new maintainer.
Please see [this announcement](https://github.com/textX/textX-LS/issues/68).

## Required textX Generator Plugins

Expand Down Expand Up @@ -47,13 +43,17 @@ Building a custom VS Code extension for newly registered language is delegated t

## Development Setup

This project requires _python 3.6_ and _node v10.16_ for development.

**Installation steps:**

1. `python -m venv env && source env/bin/activate`
1. `pip install -r requirements.txt`
1. `cd client && npm i`
1. Install [Nix](https://nixos.org/download/) (used for reproducible envs).
Be sure to configure flake feature by adding:
```
experimental-features = nix-command flakes
```
to `~/.config/nix/nix.conf`. See more here: https://nixos.wiki/wiki/flakes

1. `nix develop` - will create a shell with all dependencies. See [direnv tool](https://direnv.net/)
which can be used to automate this step.

To register _pre-commit_ hooks, run: `pre-commit install`
To run _pre-commit_ hooks manually: `pre-commit run --all-files`
Expand All @@ -62,10 +62,29 @@ To run _pre-commit_ hooks manually: `pre-commit run --all-files`

In order to run the extension, **client** directory must be added as a workspace folder or opened as a root project.

E.g. you can run:

``` sh
code --extensions-dir vscode-extensions client
```

Now, switch to _debug_ view, choose `Server + Client` option and press _F5_.

A new VS Code window should be opened in [examples](./examples) directory.

Alternatively, you can run server as a separate process from the cli. See script
`textX-LS/server/run_server.sh`. In that case choose debug configuration `Launch
Client` in VS Code.

Logging of LSP messages is done to the user log folder:

| Platform | Log file |
|----------|----------------------------------------------------------------------------------------|
| Linux | `~/.local/state/textX/textx_ls_server.log` or `~/.cache/textX/log/textx_ls_server.log` |
| macOS | `~/Library/Logs/textX/textx_ls_server.log` |
| Windows | `%LOCALAPPDATA%\textX\Logs\textx_ls_server.log` |


## CI/CD and Artifacts

Take a look at [build process](./azure-devops/README.md).
Expand Down
8 changes: 7 additions & 1 deletion client/.vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
{
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": ["dbaeumer.vscode-eslint", "connor4312.esbuild-problem-matchers", "ms-vscode.extension-test-runner"]
"recommendations": [
"dbaeumer.vscode-eslint",
"connor4312.esbuild-problem-matchers",
"ms-python.python",
"ms-python.debugpy",
"ms-vscode.extension-test-runner"
]
}
2 changes: 1 addition & 1 deletion client/.vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"type": "npm",
"script": "watch:esbuild",
"group": "build",
// "problemMatcher": "$esbuild-watch",
"problemMatcher": "$esbuild-watch",
"isBackground": true,
"label": "npm: watch:esbuild",
"presentation": {
Expand Down
2 changes: 1 addition & 1 deletion client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ textX for VS Code extension provides a syntax highlighting and intellisense for

There are two options for _installing_ a textX language project:

- **editable mode** - by _right_ clicking on a project root directory, or a _setup.py_ file and clicking on `Install textX project`
- **editable mode** - by _right_ clicking on a project root directory, or a _setup.py_, _setup.cfg_, or _pyproject.toml_ file and clicking on `Install textX project`
- **from wheel** - by opening a _textX view_, clicking on a _plus_ (+) icon and choosing a wheel (previously built manually)

Install in an editable mode| Install from a wheel
Expand Down
6 changes: 4 additions & 2 deletions client/bin/copy-wheels.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ server_dist_dir="$server_dir/dist"


# Build wheels
cd $core_dir && python setup.py sdist bdist_wheel clean --all
cd $server_dir && python setup.py sdist bdist_wheel clean --all
rm "$core_dist_dir"/*
rm "$server_dist_dir"/*
cd $core_dir && flit build
cd $server_dir && flit build

# Copy wheels
cd $core_dist_dir && cp *.whl $client_wheels_dir
Expand Down
7 changes: 7 additions & 0 deletions client/make_package.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh
rm -f dist/*
rm -f wheels/*
rm *.vsix
npm run vscode:prepublish
yes | vsce package

Loading