Skip to content

Commit

Permalink
fix: Helix code actions (#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
gimalay authored Feb 15, 2025
1 parent 7830b7e commit a8c2186
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 31 deletions.
51 changes: 26 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,6 @@
# [IWE](https://iwe.md) - Markdown notes assistant
# About

## Quick demos

#### Exract notes

![Demo](https://iwe.md/images/extract.gif)

<details>
<summary>Search</summary>

![Demo](https://iwe.md/images/search.gif)

</details>

<details>
<summary>Normalization</summary>

![Demo](https://iwe.md/images/normalization.gif)

</details>

## About

IWE is a tool that helps you organize your markdown notes. It treats notes as an interconnected graph, where each document acts as a sub-tree and the links are the edges connecting them. It supports various operations designed to assist with navigating and restructuring the graph.
[IWE](https://iwe.md) is a Markdown notes assistant for your favorite text editor. It's a tool that helps you organize your Markdown notes. It treats notes as an interconnected graph, where each document acts as a sub-tree and the links are the edges connecting them. It supports various operations designed to assist with navigating and restructuring the graph.

The main focus of IWE is to help you keep your notes tidy and structured. It works with the graph at the semantic level, understanding the **headers**, **lists** and **links** defined structure of the documents.

Expand All @@ -48,7 +26,30 @@ IWE integrates seamlessly with your editor, helping you to:
- **Convert** lists into headers and vice versa
- Display **inlay hints** with parent note references and link counts

Please visit [IWE.md](https://iwe.md) for more information.
Please visit [IWE.md](https://iwe.md) for more information and [quick start guide](https://iwe.md/quick-start/).

### Demos

<details>
<summary>Notes search</summary>

![Demo](https://iwe.md/images/search.gif)

</details>

<details>
<summary>Auto-formatting</summary>

![Demo](https://iwe.md/images/normalization.gif)

</details>

<details>
<summary>Extract note</summary>

![Demo](https://iwe.md/images/extract.gif)

</details>

## Command Line Utility Mode

Expand Down
1 change: 0 additions & 1 deletion crates/iwes/src/router/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,6 @@ impl Server {
&params.text_document.uri.to_key(base_path),
params.range.start.line as usize,
)
.filter(|_| params.range.empty())
.map(|node_id| {
vec![
ActionType::SectionExtract,
Expand Down
15 changes: 10 additions & 5 deletions crates/iwes/tests/inline_section_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ use std::u32;

use indoc::indoc;
use lsp_types::{
CodeAction, CodeActionContext, CodeActionOrCommand, CodeActionParams, DeleteFile,
DocumentChangeOperation, DocumentChanges, OneOf, OptionalVersionedTextDocumentIdentifier,
Position, Range, ResourceOp, TextDocumentEdit, TextDocumentIdentifier, TextEdit,
CodeAction, CodeActionContext, CodeActionOrCommand, CodeActionParams, CodeActionTriggerKind,
DeleteFile, DocumentChangeOperation, DocumentChanges, OneOf,
OptionalVersionedTextDocumentIdentifier, Position, Range, ResourceOp, TextDocumentEdit,
TextDocumentIdentifier, TextEdit,
};

use fixture::{action_kind, action_kinds, uri};
Expand Down Expand Up @@ -211,13 +212,17 @@ fn assert_inlined(source: &str, line: u32, inlined: &str) {
fixture.code_action(
CodeActionParams {
text_document: TextDocumentIdentifier { uri: uri(1) },
range: Range::new(Position::new(line, 0), Position::new(line, 0)),
range: Range::new(
Position::new(line, 0),
// helix editor provides range even if nothing selected.
Position::new(line + 1, 1),
),
work_done_progress_params: Default::default(),
partial_result_params: Default::default(),
context: CodeActionContext {
diagnostics: Default::default(),
only: action_kinds("refactor.inline.reference.section"),
trigger_kind: None,
trigger_kind: Some(CodeActionTriggerKind::INVOKED),
},
},
vec![CodeActionOrCommand::CodeAction(CodeAction {
Expand Down

0 comments on commit a8c2186

Please sign in to comment.