Skip to content

Commit 5f1622a

Browse files
committed
Release 1.0.1
- Fix type hints being provided when typing ':' within strings under a function definition. - Rename static/ to images/
1 parent 9002da2 commit 5f1622a

File tree

6 files changed

+11
-6
lines changed

6 files changed

+11
-6
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Change Log
22

3-
## [1.0.0]
3+
## [1.0.1] - 2020-04-13
4+
5+
* Fixed type hints sometimes being provided when typing ':' within a string.
6+
7+
## [1.0.0] - 2020-04-09
48

59
* Initial release

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Provides type hint auto-completion for Python, with completion items for built-in types, classes and the typing module.
44

55

6-
![](static/demo.gif)
6+
![](images/demo.gif)
77

88
## Features
99

File renamed without changes.
File renamed without changes.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"name": "vscode-python-typehint",
33
"displayName": "Python Type Hint",
4-
"version": "1.0.0",
4+
"version": "1.0.1",
55
"publisher": "njqdev",
66
"description": "Type hint completion for Python.",
7-
"icon": "static/icon.png",
7+
"icon": "images/icon.png",
88
"repository": {
99
"type": "git",
1010
"url": "https://github.com/njqdev/vscode-python-typehint"

src/completionProvider.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,12 @@ export class ParamHintCompletionProvider extends CompletionProvider implements C
133133
}
134134

135135
/**
136-
* The text is invalid if it is a comment, dict or the end of the function definition.
136+
* The text is invalid if it is a comment, dict,
137+
* the end of the function definition or preceding a ':' within a string.
137138
*/
138139
private isInvalid(precedingText: string): boolean {
139140
if (precedingText) {
140-
return new RegExp("#|\\)$|{ *[a-zA-Z0-9.+*/\\(\\)-]+$").test(precedingText);
141+
return new RegExp(`#|\\)$|['"][^'",]*$|{ *[a-zA-Z0-9.+*/\\(\\)-]+$`).test(precedingText);
141142
}
142143
return true;
143144
}

0 commit comments

Comments
 (0)