Skip to content

Commit

Permalink
Support more version specifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielSchiavini committed Jul 9, 2024
1 parent 5232a3c commit b66684d
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 62 deletions.
2 changes: 1 addition & 1 deletion .idea/modules/vyper-plugin.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

58 changes: 29 additions & 29 deletions .idea/modules/vyper-plugin.main.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

58 changes: 29 additions & 29 deletions .idea/modules/vyper-plugin.test.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class CompilerAnnotator : ExternalAnnotator<FileInfo, List<CompilerError>>(), Du
VyperCompilerDocker(info.project, info.file, info.version, info.indicator).run()
} catch (e: CompilerMissingError) {
LOG.error("Error while running compiler annotator", e)
null
null // todo: return warning to the editor
}
if (result?.statusDocker == StatusDocker.FAILED) {
return parseErrors(info, result);
Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/org/vyperlang/plugin/psi/VyperFile.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import org.vyperlang.plugin.VyperLanguage
import org.vyperlang.plugin.psi.VyperTypes.COMMENT

private val CommentTokens = TokenSet.create(COMMENT, WHITE_SPACE)
private val PragmaRegex = "#\\s*(?:pragma\\s+|@)version\\s+\\^?(\\d+\\.\\d+\\.\\d+)".toRegex()
private val PragmaRegex = "#\\s*(?:pragma\\s+|@)version\\s+[\\^><~]?(\\d+\\.\\d+\\.\\d+)".toRegex()


class VyperFile(viewProvider: FileViewProvider) : PsiFileBase(viewProvider, VyperLanguage) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class TestColorAnnotator : BasePlatformTestCase() {
checkErrors(
VyperInterfaceFileType.INSTANCE,
"""
# pragma version ^0.3.0
# pragma version >0.3.0
@view
@internal
def balanceOf(_owner: address) -> uint256:
Expand Down

0 comments on commit b66684d

Please sign in to comment.