Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ All notable changes to the Path Server will be documented in this file.

### Added
- Added language support assert to tree-sitter parser tests.
- **Core**: Added support for extracting paths from comments that use markdown syntax.
- **Core**: Added MDX language support. ([#43](https://github.com/kunlinglio/path-server/pull/43))

## [1.3.1] - 2026-05-29
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ Run `zed: open settings file` from the command palette to edit user settings jso
- [x] Support path highlight.
- [x] Support remote window.
- [x] Improve path extraction precision.
- [ ] **Zed**: Support all language by use "wildcard" in extension.toml (Waiting for Zed extension api support)
- [x] Extract paths from comments that use markdown syntax.

## Development
### Recommended Workflow
Expand Down
8 changes: 4 additions & 4 deletions src/document/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ impl Document {
utf16_position_to_offset(&self.index, line, character)
}

pub fn offset_to_utf8_pos(&self, offset: usize) -> PathServerResult<(usize, usize)> {
offset_to_utf8_position(&self.index, offset)
pub fn offset_to_byte_pos(&self, offset: usize) -> (usize, usize) {
offset_to_byte_position(&self.index, offset)
}

pub fn get_tree(&self) -> Option<&Tree> {
Expand Down Expand Up @@ -172,10 +172,10 @@ fn offset_to_utf16_position(index: &LineIndex, offset: usize) -> PathServerResul
Ok((wide_offset.line as usize, wide_offset.col as usize))
}

fn offset_to_utf8_position(index: &LineIndex, offset: usize) -> PathServerResult<(usize, usize)> {
fn offset_to_byte_position(index: &LineIndex, offset: usize) -> (usize, usize) {
let text_offset = TextSize::new(offset as u32);
let line_col = index.line_col(text_offset);
Ok((line_col.line as usize, line_col.col as usize))
(line_col.line as usize, line_col.col as usize)
}

#[cfg(test)]
Expand Down
Loading
Loading