on master help sign in
minor: Remove old TODOs
20f33eaBlaž Hrastnik
TODO.md+2−17
@@ -1,8 +1,3 @@
1−- Refactor tree-sitter-highlight to work like the atom one, recomputing partial tree updates.
2−
3−------
4−
5−as you type completion!
6
1
7- tree sitter:
2- tree sitter:
8 - lua
3 - lua
@@ -15,20 +10,16 @@ as you type completion!
15 - clojure
10 - clojure
16 - erlang
11 - erlang
17
12
13+as you type completion!
18- [ ] use signature_help_provider and completion_provider trigger characters in
14- [ ] use signature_help_provider and completion_provider trigger characters in
19 a hook to trigger signature help text / autocompletion
15 a hook to trigger signature help text / autocompletion
20- [ ] document.on_type provider triggers
16- [ ] document.on_type provider triggers
21- [ ] completion isIncomplete support
17- [ ] completion isIncomplete support
22
18
23−- [ ] scroll wheel support
24−- [ ] matching bracket highlight
25−
261
191
27- [ ] respect view fullscreen flag
20- [ ] respect view fullscreen flag
28- [ ] Implement marks (superset of Selection/Range)
21- [ ] Implement marks (superset of Selection/Range)
29
22
30−- [ ] nixos packaging
31−
32- [ ] = for auto indent line/selection
23- [ ] = for auto indent line/selection
33- [ ] :x for closing buffers
24- [ ] :x for closing buffers
34
25
@@ -37,25 +28,19 @@ as you type completion!
37- [] jump to alt buffer
28- [] jump to alt buffer
38
29
39- [ ] lsp: signature help
30- [ ] lsp: signature help
40−- [x] lsp: hover
41−- [ ] lsp: document symbols (nested/vec)
42- [ ] lsp: code actions
31- [ ] lsp: code actions
43- [ ] lsp: formatting
32- [ ] lsp: formatting
44−- [x] lsp: goto
45
33
46- [ ] search: smart case by default: insensitive unless upper detected
34- [ ] search: smart case by default: insensitive unless upper detected
47
35
48- [ ] move Compositor into tui
36- [ ] move Compositor into tui
49
37
502
382
51−- [ ] surround bindings (select + surround ( wraps selection in parens )
52- [ ] macro recording
39- [ ] macro recording
53- [ ] extend selection (treesitter select parent node) (replaces viw, vi(, va( etc )
40- [ ] extend selection (treesitter select parent node) (replaces viw, vi(, va( etc )
54−- [x] bracket pairs
55−- [x] comment block (gcc)
56- [ ] selection align
41- [ ] selection align
57- [ ] store some state between restarts: file positions, prompt history
42- [ ] store some state between restarts: file positions, prompt history
58−- [ ] highlight matched characters in completion
43+- [ ] highlight matched characters in picker
59
44
603
453
61- [ ] diff mode with highlighting?
46- [ ] diff mode with highlighting?
helix-term/README.mddeleted−7
@@ -1,7 +0,0 @@
1−
2−window -> buffer -> text
3−\-> contains "view", a viewport into the buffer
4−
5−view
6−\-> selections etc
7−-> cursor
helix-term/src/application.rs−2
@@ -229,7 +229,6 @@ impl Application {
229 None => return,
229 None => return,
230 };
230 };
231
231
232− // TODO: parse should return Result/Option
233 match notification {
232 match notification {
234 Notification::PublishDiagnostics(params) => {
233 Notification::PublishDiagnostics(params) => {
235 let path = Some(params.uri.to_file_path().unwrap());
234 let path = Some(params.uri.to_file_path().unwrap());
@@ -298,7 +297,6 @@ impl Application {
298 .collect();
297 .collect();
299
298
300 doc.set_diagnostics(diagnostics);
299 doc.set_diagnostics(diagnostics);
301− // TODO: we want to process all the events in queue, then render. publishDiagnostic tends to send a whole bunch of events
302 }
300 }
303 }
301 }
304 Notification::ShowMessage(params) => {
302 Notification::ShowMessage(params) => {
helix-term/src/commands.rs−42
@@ -446,8 +446,6 @@ fn extend_next_word_end(cx: &mut Context) {
446#[inline]
446#[inline]
447fn find_char_impl<F>(cx: &mut Context, search_fn: F, inclusive: bool, extend: bool)
447fn find_char_impl<F>(cx: &mut Context, search_fn: F, inclusive: bool, extend: bool)
448where
448where
449− // TODO: make an options struct for and abstract this Fn into a searcher type
450− // use the definition for w/b/e too
451 F: Fn(RopeSlice, char, usize, usize, bool) -> Option<usize> + 'static,
449 F: Fn(RopeSlice, char, usize, usize, bool) -> Option<usize> + 'static,
452{
450{
453 // TODO: count is reset to 1 before next key so we move it into the closure here.
451 // TODO: count is reset to 1 before next key so we move it into the closure here.
@@ -652,10 +650,6 @@ fn scroll(cx: &mut Context, offset: usize, direction: Direction) {
652
650
653 let scrolloff = PADDING.min(view.area.height as usize / 2); // TODO: user pref
651 let scrolloff = PADDING.min(view.area.height as usize / 2); // TODO: user pref
654
652
655− // cursor visual offset
656− // TODO: only if dragging via mouse?
657− // let cursor_off = cursor.row - view.first_line;
658−
659 view.first_line = match direction {
653 view.first_line = match direction {
660 Forward => view.first_line + offset,
654 Forward => view.first_line + offset,
661 Backward => view.first_line.saturating_sub(offset),
655 Backward => view.first_line.saturating_sub(offset),
@@ -812,13 +806,6 @@ fn split_selection_on_newline(cx: &mut Context) {
812 doc.set_selection(view.id, selection);
806 doc.set_selection(view.id, selection);
813}
807}
814
808
815−// search: searches for the first occurence in file, provides a prompt
816−// search_next: reuses the last search regex and searches for the next match. The next match becomes the main selection.
817−// -> we always search from after the cursor.head
818−// TODO: be able to use selection as search query (*/alt *)
819−// I'd probably collect all the matches right now and store the current index. The cache needs
820−// wiping if input happens.
821−
822fn search_impl(doc: &mut Document, view: &mut View, contents: &str, regex: &Regex, extend: bool) {
809fn search_impl(doc: &mut Document, view: &mut View, contents: &str, regex: &Regex, extend: bool) {
823 let text = doc.text();
810 let text = doc.text();
824 let selection = doc.selection(view.id);
811 let selection = doc.selection(view.id);
@@ -847,7 +834,6 @@ fn search_impl(doc: &mut Document, view: &mut View, contents: &str, regex: &Rege
847 Selection::single(start, head)
834 Selection::single(start, head)
848 };
835 };
849
836
850− // TODO: (first_match, regex) stuff in register?
851 doc.set_selection(view.id, selection);
837 doc.set_selection(view.id, selection);
852 align_view(doc, view, Align::Center);
838 align_view(doc, view, Align::Center);
853 };
839 };
@@ -905,12 +891,6 @@ fn search_selection(cx: &mut Context) {
905 search_next(cx);
891 search_next(cx);
906}
892}
907
893
908−// TODO: N -> search_prev
909−// need to loop around buffer also and show a message
910−// same for no matches
911−
912−//
913−
914fn extend_line(cx: &mut Context) {
894fn extend_line(cx: &mut Context) {
915 let count = cx.count();
895 let count = cx.count();
916 let (view, doc) = current!(cx.editor);
896 let (view, doc) = current!(cx.editor);
@@ -931,8 +911,6 @@ fn extend_line(cx: &mut Context) {
931 doc.set_selection(view.id, Selection::single(start, end));
911 doc.set_selection(view.id, Selection::single(start, end));
932}
912}
933
913
934−// heuristic: append changes to history after each command, unless we're in insert mode
935−
936fn delete_selection_impl(reg: &mut Register, doc: &mut Document, view_id: ViewId) {
914fn delete_selection_impl(reg: &mut Register, doc: &mut Document, view_id: ViewId) {
937 // first yank the selection
915 // first yank the selection
938 let values: Vec<String> = doc
916 let values: Vec<String> = doc
@@ -1568,9 +1546,6 @@ mod cmd {
1568}
1546}
1569
1547
1570fn command_mode(cx: &mut Context) {
1548fn command_mode(cx: &mut Context) {
1571− // TODO: completion items should have a info section that would get displayed in
1572− // a popup above the prompt when items are tabbed over
1573−
1574 let mut prompt = Prompt::new(
1549 let mut prompt = Prompt::new(
1575 ":".to_owned(),
1550 ":".to_owned(),
1576 |input: &str| {
1551 |input: &str| {
@@ -2522,7 +2497,6 @@ fn redo(cx: &mut Context) {
2522// Yank / Paste
2497// Yank / Paste
2523
2498
2524fn yank(cx: &mut Context) {
2499fn yank(cx: &mut Context) {
2525− // TODO: should selections be made end inclusive?
2526 let (view, doc) = current!(cx.editor);
2500 let (view, doc) = current!(cx.editor);
2527 let values: Vec<String> = doc
2501 let values: Vec<String> = doc
2528 .selection(view.id)
2502 .selection(view.id)
@@ -2703,16 +2677,6 @@ fn replace_selections_with_clipboard(cx: &mut Context) {
2703 replace_selections_with_clipboard_impl(&mut cx.editor);
2677 replace_selections_with_clipboard_impl(&mut cx.editor);
2704}
2678}
2705
2679
2706−// alt-p => paste every yanked selection after selected text
2707−// alt-P => paste every yanked selection before selected text
2708−// R => replace selected text with yanked text
2709−// alt-R => replace selected text with every yanked text
2710−//
2711−// append => insert at next line
2712−// insert => insert at start of line
2713−// replace => replace
2714−// default insert
2715−
2716fn paste_after(cx: &mut Context) {
2680fn paste_after(cx: &mut Context) {
2717 let reg_name = cx.selected_register.name();
2681 let reg_name = cx.selected_register.name();
2718 let (view, doc) = current!(cx.editor);
2682 let (view, doc) = current!(cx.editor);
@@ -3019,12 +2983,6 @@ fn completion(cx: &mut Context) {
3019 };
2983 };
3020 },
2984 },
3021 );
2985 );
3022− // TODO: Server error: content modified
3023−
3024− // // TODO!: when iterating over items, show the docs in popup
3025−
3026− // // language server client needs to be accessible via a registry of some sort
3027− //}
3028}
2986}
3029
2987
3030fn hover(cx: &mut Context) {
2988fn hover(cx: &mut Context) {
helix-term/src/main.rs−5
@@ -8,11 +8,6 @@ use anyhow::{Context, Result};
8fn setup_logging(logpath: PathBuf, verbosity: u64) -> Result<()> {
8fn setup_logging(logpath: PathBuf, verbosity: u64) -> Result<()> {
9 let mut base_config = fern::Dispatch::new();
9 let mut base_config = fern::Dispatch::new();
10
10
11− // Let's say we depend on something which whose "info" level messages are too
12− // verbose to include in end-user output. If we don't need them,
13− // let's not include them.
14− // .level_for("overly-verbose-target", log::LevelFilter::Warn)
15−
16 base_config = match verbosity {
11 base_config = match verbosity {
17 0 => base_config.level(log::LevelFilter::Warn),
12 0 => base_config.level(log::LevelFilter::Warn),
18 1 => base_config.level(log::LevelFilter::Info),
13 1 => base_config.level(log::LevelFilter::Info),
helix-term/src/ui/completion.rs+3−22
@@ -68,7 +68,7 @@ impl menu::Item for CompletionItem {
68
68
69/// Wraps a Menu.
69/// Wraps a Menu.
70pub struct Completion {
70pub struct Completion {
71− popup: Popup<Menu<CompletionItem>>, // TODO: Popup<Menu> need to be able to access contents.
71+ popup: Popup<Menu<CompletionItem>>,
72 trigger_offset: usize,
72 trigger_offset: usize,
73 // TODO: maintain a completioncontext with trigger kind & trigger char
73 // TODO: maintain a completioncontext with trigger kind & trigger char
74}
74}
@@ -82,28 +82,10 @@ impl Completion {
82 // let items: Vec<CompletionItem> = Vec::new();
82 // let items: Vec<CompletionItem> = Vec::new();
83 let mut menu = Menu::new(items, move |editor: &mut Editor, item, event| {
83 let mut menu = Menu::new(items, move |editor: &mut Editor, item, event| {
84 match event {
84 match event {
85− PromptEvent::Abort => {
85+ PromptEvent::Abort => {}
86− // revert state
87− // let id = editor.view().doc;
88− // let doc = &mut editor.documents[id];
89− // doc.state = snapshot.clone();
90− }
91 PromptEvent::Validate => {
86 PromptEvent::Validate => {
92 let (view, doc) = current!(editor);
87 let (view, doc) = current!(editor);
93
88
94− // revert state to what it was before the last update
95− // doc.state = snapshot.clone();
96−
97− // extract as fn(doc, item):
98−
99− // TODO: need to apply without composing state...
100− // TODO: need to update lsp on accept/cancel by diffing the snapshot with
101− // the final state?
102− // -> on update simply update the snapshot, then on accept redo the call,
103− // finally updating doc.changes + notifying lsp.
104− //
105− // or we could simply use doc.undo + apply when changing between options
106−
107 // always present here
89 // always present here
108 let item = item.unwrap();
90 let item = item.unwrap();
109
91
@@ -143,7 +125,6 @@ impl Completion {
143
125
144 doc.apply(&transaction, view.id);
126 doc.apply(&transaction, view.id);
145
127
146− // TODO: merge edit with additional_text_edits
147 if let Some(additional_edits) = &item.additional_text_edits {
128 if let Some(additional_edits) = &item.additional_text_edits {
148 // gopls uses this to add extra imports
129 // gopls uses this to add extra imports
149 if !additional_edits.is_empty() {
130 if !additional_edits.is_empty() {
@@ -226,7 +207,7 @@ impl Component for Completion {
226 fn render(&self, area: Rect, surface: &mut Surface, cx: &mut Context) {
207 fn render(&self, area: Rect, surface: &mut Surface, cx: &mut Context) {
227 self.popup.render(area, surface, cx);
208 self.popup.render(area, surface, cx);
228
209
229− // TODO: if we have a selection, render a markdown popup on top/below with info
210+ // if we have a selection, render a markdown popup on top/below with info
230 if let Some(option) = self.popup.contents().selection() {
211 if let Some(option) = self.popup.contents().selection() {
231 // need to render:
212 // need to render:
232 // option.detail
213 // option.detail
helix-term/src/ui/editor.rs−2
@@ -123,8 +123,6 @@ impl EditorView {
123 };
123 };
124
124
125 // TODO: range doesn't actually restrict source, just highlight range
125 // TODO: range doesn't actually restrict source, just highlight range
126− // TODO: cache highlight results
127− // TODO: only recalculate when state.doc is actually modified
128 let highlights: Vec<_> = match doc.syntax() {
126 let highlights: Vec<_> = match doc.syntax() {
129 Some(syntax) => {
127 Some(syntax) => {
130 syntax
128 syntax
helix-term/src/ui/mod.rs−2
@@ -42,7 +42,6 @@ pub fn regex_prompt(
42 move |editor: &mut Editor, input: &str, event: PromptEvent| {
42 move |editor: &mut Editor, input: &str, event: PromptEvent| {
43 match event {
43 match event {
44 PromptEvent::Abort => {
44 PromptEvent::Abort => {
45− // TODO: also revert text
46 let (view, doc) = current!(editor);
45 let (view, doc) = current!(editor);
47 doc.set_selection(view.id, snapshot.clone());
46 doc.set_selection(view.id, snapshot.clone());
48 }
47 }
@@ -61,7 +60,6 @@ pub fn regex_prompt(
61 let registers = &mut editor.registers;
60 let registers = &mut editor.registers;
62
61
63 // revert state to what it was before the last update
62 // revert state to what it was before the last update
64− // TODO: also revert text
65 doc.set_selection(view.id, snapshot.clone());
63 doc.set_selection(view.id, snapshot.clone());
66
64
67 fun(view, doc, registers, regex);
65 fun(view, doc, registers, regex);
helix-term/src/ui/picker.rs−2
@@ -256,8 +256,6 @@ impl<T: 'static> Component for Picker<T> {
256 let inner = block.inner(area);
256 let inner = block.inner(area);
257
257
258 block.render(area, surface);
258 block.render(area, surface);
259− // TODO: abstract into a clear(area) fn
260− // surface.set_style(inner, Style::default().bg(Color::Rgb(150, 50, 0)));
261
259
262 // -- Render the input bar:
260 // -- Render the input bar:
263
261