Skip to content
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

Completion -- when not exactly at the end of the line #6

Closed
olegklimov opened this issue Nov 21, 2023 · 7 comments
Closed

Completion -- when not exactly at the end of the line #6

olegklimov opened this issue Nov 21, 2023 · 7 comments

Comments

@olegklimov
Copy link
Contributor

Cursor is not at the end of the line, but behind some special characters (regex) like closing parenthesis: "def f(x: stri|):", completion should give "ng):" and replace the rest or the string.

image

From VS Code the regex is:

let right_of_cursor_has_only_special_chars = Boolean(right_of_cursor.match(/^[:\s\t\n\r(){},."'];]*$/));

The other keyword is "multiline=False", the model switches to a special mode to replace the rest of the current string.

@sakshambp
Copy link

What is expected behaviour? Is it to retain the special characters such as ) while replacing string?

@olegklimov
Copy link
Contributor Author

retain the special characters such as ) while replacing string

Right, it does this by relying on the model -- that it will produce all the characters needed. The plugin need to replace the rest of the current string with the model output.

@sakshambp
Copy link

Can you please provide me steps on how do i setup local dev environment? I can work on this

@olegklimov
Copy link
Contributor Author

Oh awesome that you want to check it out!

I can't reproduce the exact steps I followed to install it on my Windows box, but I remember it was easy.

Something like:

  • Install Visual Studio
  • git clone the repo
  • Open it in VS
  • Agree to download a plugin development SDK of some sort
    => You can run and debug it by pressing F5

If you want to try this, you can record your actions and write it down to CONTRIBUTING.md -- that would we fantastic.

@digital-phoenix
Copy link
Contributor

digital-phoenix commented Nov 28, 2023

@sakshambp this may not be the best issue for you to work on as it requires a major refactor to get the plugin to insert grey text in between the text in the document.

digital-phoenix pushed a commit to digital-phoenix/refact-vs-classic that referenced this issue Nov 30, 2023
olegklimov pushed a commit that referenced this issue Dec 26, 2023
* adding files for refact extension

* testing github workflow

* removing default exe to test workflow

* uploading artifacts in workflow

* readding exe

* cleaning up files

* C/C++ now works with grey text

* fixed minor typo

* can now select intellisense options, whitespace causes less problems for grey text completions and the code will only ask for completions when the cursor is at the end of a line

* removing binary and updating build scripts

* fixing build script typo

* fixing minor build naming issue

* Updating code to be consistent with new build script

* improved the options page

* added comments and fixed formatting

* updating enter behaviour

* fixing minor bugs and functional issues

* added code to fix issues around single vs multiline completions issues #9 and #6

* added scroll bars for the options page

* adding status bar and killing server process on shutdown

* fixing minor bug where grey text was inserted into incorrect places
@olegklimov
Copy link
Contributor Author

It almost works, renders it wrong a bit. Should be a small fix.

IMAGE 2024-01-02 23:42:46

^^ on the screenshot: shows ); in black not quite at the right place, shows "AlignCenter" correctly.

@hazratisulton
Copy link

Checked plugin version 0.0.2 from marketplace - problem is no longer reproducible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants