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

Fix infitite loop on undefined message #37

Merged
merged 2 commits into from
Jun 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
All notable changes to the "arbeditor" extension will be documented in this file.

Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file.
## [0.0.9]

- Fix [#36](https://github.com/google/arb-editor/issues/36).
## [0.0.8]

- Add an icon
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"publisher": "Google",
"displayName": "ARB Editor",
"description": "Editor for Application Resource Bundle files, used for localization.",
"version": "0.0.8",
"version": "0.0.9",
"engines": {
"vscode": "^1.72.2"
},
Expand Down
3 changes: 3 additions & 0 deletions src/codeactions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ export class CodeActions implements vscode.CodeActionProvider {

private createPlaceholder(document: vscode.TextDocument, range: vscode.Range | vscode.Selection): vscode.CodeAction | undefined {
const placeholder = this.messageList?.getMessageAt(document.offsetAt(range.start)) as Placeholder | undefined;
if (!placeholder) {
return;
}
var parent = placeholder?.parent;
while (!(parent instanceof MessageEntry)) {
parent = parent?.parent;
Expand Down