We're excited to announce the latest release of our project. This update brings several improvements and bug fixes to enhance your development experience.
✨ What's New
📁 File Handling and Project Management
- Improved file listing with relative paths (thanks prabhuteja12 for reporting)
- Added support for `.gitignore` when listing files
- Implemented a tree-like formatter for listed files (details below)
- New `languages` parameter for project creation (details below)
🐳 Devcontainer and LSP Enhancements
- Added support for local images (thanks prabhuteja12 for reporting)
- Improved language detection using [go-enry](https://github.com/go-enry/go-enry)
- Implemented graceful shutdown of LSP servers
🚀 Performance and Bug Fixes
- Fixed an issue where LSP wasn't stopping when deleting a project (thanks wistuba for reporting)
- Fixed a bug related to missing `Close()` call in the gitignore reader (thanks wistuba for reporting)
We hope you enjoy this new release! As always, we welcome your feedback and contributions.
🔦 New `languages` parameter
We've introduced a new `languages` parameter to give you more control over LSP server initialization when creating a project. Here's what you need to know:
🧠 Background
When hide receives a request to create a new project, it attempts to detect the main programming language(s) to launch relevant LSP servers. While we've significantly improved the accuracy of language detection using [go-enry](https://github.com/go-enry/go-enry), we understand that sometimes you may want more explicit control.
⚙️ How It Works
The new `languages` parameter allows you to specify which LSP servers to start when creating a project. This ensures that you have the exact language support you need, regardless of automatic detection results.
🗣️ Supported Languages
The languages parameter currently supports the following values:
- Go
- JavaScript
- Python
- TypeScript
💡 Usage Examples
cURL
bash
curl --location 'http://localhost:8080/projects' \
--header 'Content-Type: application/json' \
--data '{
"repository": {
"url": "https://github.com/sphinx-doc/sphinx.git"
},
"devcontainer": {
"image": "mcr.microsoft.com/devcontainers/python:3.12",
"onCreateCommand": "pip install -e ."
},
"languages": [
"Python"
]
}'
Python
python
import hide
from hide import model
hc = hide.Client()
Create project with specific language support
project = hc.create_project(
repository=model.Repository(url="https://github.com/your-username/your-repo"),
languages=[model.Language.PYTHON]
)
📝 Note
If the `languages` parameter is not provided, hide will fall back to its automatic language detection using [go-enry](https://github.com/go-enry/go-enry).
🌳 Tree-like formatter
We've introduced a new tree-like format for listing files in your projects. This feature aims to provide a more intuitive and familiar representation of your project structure.
🧠 Background
JSON has been our foundation for representing file structures due to its flexibility and widespread use in data transport. It's an excellent base format that allows building various representations on top of it using SDK. However, we recognized the value in providing some common, ready-to-use formats directly from the API. This approach saves development time and offers immediate utility for many use cases, including AI agents that benefit from familiar, hierarchical representations.
⚙️ How It Works
The new tree-like formatter presents your project's file structure in a format similar to what you'd see when using the `tree` utility in a shell. This hierarchical representation makes it easier to visualize the structure of your project at a glance.
💡 Usage Example
To use the new tree-like format, you can specify in your API request. Here's an example using cURL:
bash
curl --location 'http://localhost:8080/projects/{project_id}/files' \
--header 'Accept: text/plain'
The response will look something like this:
.
├── src/
│ ├── main.py
│ └── utils/
│ ├── helper.py
│ └── config.py
├── tests/
│ ├── test_main.py
│ └── test_utils.py
├── README.md
└── requirements.txt
Here's an example in Python:
python
import hide
from hide import model
hc = hide.Client()
Create project with specific language support
project = hc.create_project(
repository=model.Repository(url="https://github.com/your-username/your-repo")
)
files = hc.list_files(
project_id=project.id,
format=model.ListFilesFormat.TREE
)
👏 Changelog
* pkg/files: use relative paths in listed files by artmoskvin in https://github.com/hide-org/hide/pull/113
* pkg/devcontainer: support local images by aleh-null in https://github.com/hide-org/hide/pull/119
* pkg/gitignore: read gitignore file and extract patterns by aleh-null in https://github.com/hide-org/hide/pull/117
* pkg/lsp: use go-enry for language detection by artmoskvin in https://github.com/hide-org/hide/pull/121
* pkg/files: wire in gitignore by aleh-null in https://github.com/hide-org/hide/pull/122
* rename hide org by artmoskvin in https://github.com/hide-org/hide/pull/124
* pkg/project: add languages parameter by artmoskvin in https://github.com/hide-org/hide/pull/125
* pkg/project: stop lsp when deleting project by artmoskvin in https://github.com/hide-org/hide/pull/128
* pkg/gitignore: bugfix missing Close() by aleh-null in https://github.com/hide-org/hide/pull/130
* pkg/frmtr: implement a tree like formater for path by aleh-null in https://github.com/hide-org/hide/pull/126
* pkg/lsp: shutdown lsp servers gracefully by artmoskvin in https://github.com/hide-org/hide/pull/131
* pkg/handlers: enable "text/plain" return from ListFiles by aleh-null in https://github.com/hide-org/hide/pull/132
**Full Changelog**: https://github.com/hide-org/hide/compare/v0.4.0...v0.4.1