-
Notifications
You must be signed in to change notification settings - Fork 46
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
add proto and path checks #118
Changes from 5 commits
8a8a795
f3fe0b3
47b6e84
e25ecd8
db2a5d8
1f323af
a30a004
3136bac
f2c6a3c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -308,6 +308,7 @@ protected override void BeforeQueryStatus(EventArgs e) | |
|
||
protected override async Task ExecuteAsync(OleMenuCmdEventArgs e) | ||
{ | ||
await CodeiumVSPackage.Instance.LogAsync("IN WINDOW DILAOG"); | ||
// get the caret screen position and create the dialog at that position | ||
TextBounds caretLine = docView.TextView.TextViewLines.GetCharacterBounds( | ||
docView.TextView.Caret.Position.BufferPosition); | ||
|
@@ -318,7 +319,7 @@ protected override async Task ExecuteAsync(OleMenuCmdEventArgs e) | |
// highlight the selected codeblock | ||
TextHighlighter? highlighter = TextHighlighter.GetInstance(docView.TextView); | ||
highlighter?.AddHighlight(start_position, end_position - start_position); | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Eventually we should add a formatter to prevent these whitespace changes from making it in |
||
await CodeiumVSPackage.Instance.LogAsync("IN WINDOW DILAOG1"); | ||
var dialog = RefactorCodeDialogWindow.GetOrCreate(); | ||
string? prompt = | ||
await dialog.ShowAndGetPromptAsync(languageInfo, caretScreenPos.X, caretScreenPos.Y); | ||
|
@@ -330,18 +331,24 @@ protected override async Task ExecuteAsync(OleMenuCmdEventArgs e) | |
|
||
LanguageServerController controller = | ||
(Package as CodeiumVSPackage).LanguageServer.Controller; | ||
|
||
CodeiumVSPackage.Instance.Log("CALLING refactor"); | ||
if (is_function) | ||
{ | ||
CodeiumVSPackage.Instance.Log("CALLING FUNC"); | ||
FunctionInfo? functionInfo = await GetFunctionInfoAsync(); | ||
|
||
if (functionInfo != null) | ||
await controller.RefactorFunctionAsync( | ||
prompt, docView.Document.FilePath, functionInfo); | ||
{ | ||
CodeiumVSPackage.Instance.Log("CALLING FUNC"); | ||
await controller.RefactorFunctionAsync( | ||
prompt, docView.Document.FilePath, functionInfo); | ||
} | ||
} | ||
else | ||
{ | ||
CodeiumVSPackage.Instance.Log("CALLING NOIN FUNC"); | ||
CodeBlockInfo codeBlockInfo = GetCodeBlockInfo(); | ||
CodeiumVSPackage.Instance.Log("CALLING NOIN FUNC2"); | ||
await controller.RefactorCodeBlockAsync( | ||
prompt, docView.Document.FilePath, languageInfo.Type, codeBlockInfo); | ||
} | ||
|
Original file line number | Diff line number | Diff line change | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -738,10 +738,10 @@ private async Task InitializeTrackedWorkspaceAsync() | |||||||||||||||||
{ | ||||||||||||||||||
try | ||||||||||||||||||
{ | ||||||||||||||||||
string projectDir = Path.GetDirectoryName(project.FullName); | ||||||||||||||||||
await _package.LogAsync($"Project Dir: {projectDir}"); | ||||||||||||||||||
if (!string.IsNullOrEmpty(projectDir)) | ||||||||||||||||||
if (!string.IsNullOrEmpty(project.FullName)) | ||||||||||||||||||
{ | ||||||||||||||||||
string projectDir = Path.GetDirectoryName(project.FullName); | ||||||||||||||||||
await _package.LogAsync($"Project Dir: {projectDir}"); | ||||||||||||||||||
AddTrackedWorkspaceResponse response = await AddTrackedWorkspaceAsync(projectDir); | ||||||||||||||||||
if (response != null) | ||||||||||||||||||
{ | ||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we log the project.FullName as well? Seeing as that's actually what's being used now?
Suggested change
|
||||||||||||||||||
|
@@ -782,7 +782,7 @@ public async Task<IList<CompletionItem>?> | |||||||||||||||||
cursor_offset = (ulong)cursorPosition, | ||||||||||||||||||
line_ending = lineEnding, | ||||||||||||||||||
absolute_path = absolutePath, | ||||||||||||||||||
absolute_path_migrate_me_to_uri = absolutePath, | ||||||||||||||||||
//absolute_path_migrate_me_to_uri = absolutePath, | ||||||||||||||||||
relative_path = Path.GetFileName(absolutePath) }, | ||||||||||||||||||
editor_options = new() { | ||||||||||||||||||
tab_size = (ulong)tabSize, | ||||||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might as well spell this right if you're gonna leave it in