Skip to content

Commit

Permalink
Fix option selection
Browse files Browse the repository at this point in the history
Closes #20
  • Loading branch information
jtanx committed Feb 2, 2022
1 parent fe728c7 commit 9d6362b
Show file tree
Hide file tree
Showing 4 changed files with 2,649 additions and 2,138 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Change Log
All notable changes to the "ctagsx" extension will be documented in this file.

## [1.2.0] - 2022-02-02
### Fixed
- Fix clash with QuickPickItem that was preventing option selection from working (#20)

## [1.1.1] - 2019-03-30
### Changed
- Preference the current text selection when navigating via the definition provider (F12). This matches the behaviour when searching via Ctrl+T.
Expand Down
8 changes: 6 additions & 2 deletions extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,11 @@ function findCTags(context, tag) {
if (!path.isAbsolute(tag.file)) {
tag.file = path.join(path.dirname(result.tagsFile), tag.file)
}
tag.description = tag.kind || ''
tag.tagKind = tag.kind
tag.description = tag.tagKind || ''
tag.label = tag.file
tag.detail = tag.address.pattern || `Line ${tag.address.lineNumber}`
delete tag.kind // #20 -> avoid conflict with QuickPickItem
return tag
})

Expand Down Expand Up @@ -152,6 +154,8 @@ function provideDefinition(document, position, canceller) {
if (!path.isAbsolute(tag.file)) {
tag.file = path.join(path.dirname(result.tagsFile), tag.file)
}
tag.tagKind = tag.kind
delete tag.kind
return tag
})

Expand Down Expand Up @@ -306,7 +310,7 @@ function getFileLineNumber(document, sel) {
function getLineNumber(entry, document, sel, canceller) {
if (entry.address.lineNumber === 0) {
return getLineNumberPattern(entry, canceller)
} else if (entry.kind === 'F') {
} else if (entry.tagKind === 'F') {
if (document) {
return getFileLineNumber(document, sel)
}
Expand Down
Loading

0 comments on commit 9d6362b

Please sign in to comment.