-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix bug with execute not sending blockIDs to the server (#58)
The bug was in how we were converting the current cell to a block before sending it to the server. We weren't using the converters that we wrote. We were using some other code that wasn't setting the metadata and therefore copying the block id to the request. * I also added a vscode function that will print the cell metadata. This is useful for debugging and troubleshooting. related to #7
- Loading branch information
Showing
4 changed files
with
45 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import * as vscode from 'vscode'; | ||
import {FoyleClient, getTraceID} from './client'; | ||
import * as converters from './converters'; | ||
import * as docpb from "../gen/foyle/v1alpha1/doc_pb"; | ||
import * as agentpb from "../gen/foyle/v1alpha1/agent_pb"; | ||
// printCell is a debug tool that prints the contents of a cell to the console | ||
// Its purpose is to help us debug problems by printing the contents of a cell | ||
// In particular the cell metadata | ||
export async function printCell() { | ||
const editor = vscode.window.activeNotebookEditor; | ||
|
||
if (!editor) { | ||
return; | ||
} | ||
|
||
if (editor?.selection.isEmpty) { | ||
return; | ||
} | ||
|
||
// We subtract 1 because end is non-inclusive | ||
const lastSelectedCell = editor?.selection.end - 1; | ||
var lastActiveCell = editor?.notebook.cellAt(lastSelectedCell); | ||
console.log(`Cell value: ${lastActiveCell.document.getText()}`); | ||
console.log(`Cell language: ${lastActiveCell.document.languageId}`); | ||
console.log(`Cell kind: ${lastActiveCell.kind}`); | ||
|
||
Object.keys(lastActiveCell.metadata).forEach(key => { | ||
console.log(`Cell Metadata key: ${key} value: ${lastActiveCell.metadata[key]}`); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters