From 444168bacec908563e57cf18e77f344e7ba61cb6 Mon Sep 17 00:00:00 2001 From: deathaxe Date: Mon, 20 May 2024 19:22:16 +0200 Subject: [PATCH] Fix pinned use-path --- WIT.sublime-syntax | 3 ++- tests/syntax_test_scopes.wit | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/WIT.sublime-syntax b/WIT.sublime-syntax index f6317c8..aa92d14 100644 --- a/WIT.sublime-syntax +++ b/WIT.sublime-syntax @@ -323,12 +323,13 @@ contexts: 1: support.interface.wit 2: punctuation.separator.path.wit # used interface (top-level use item, only) - - match: ({{id}})(?:(@)({{semver}}))? + - match: ({{id}})(?:(@)({{semver}})(\.)?)? scope: meta.path.wit captures: 1: support.interface.wit 2: punctuation.separator.version.wit 3: constant.numeric.version.wit + 4: punctuation.separator.path.wit pop: 1 - include: else-pop diff --git a/tests/syntax_test_scopes.wit b/tests/syntax_test_scopes.wit index 995690f..3838d3f 100644 --- a/tests/syntax_test_scopes.wit +++ b/tests/syntax_test_scopes.wit @@ -574,6 +574,25 @@ use wasi:clocks.wall-clock.{datetime} // ^^^^^^^^ variable.other.wit // ^ punctuation.section.sequence.end.wit +use wasi:io/poll@0.2.0.{pollable}; +// <- meta.statement.use.wit keyword.control.use.wit +//^ meta.statement.use.wit keyword.control.use.wit +// ^ meta.statement.use.path.wit - meta.path - support - keyword - variable +// ^^^^^^^^^^^^^^^^^^^ meta.statement.use.path.wit meta.path.wit +// ^^^^^^^^^^ meta.statement.use.items.wit meta.sequence.list.names.wit +// ^^^^ support.namespace.wit +// ^ punctuation.separator.path.wit +// ^^ support.namespace.package.wit +// ^ punctuation.separator.path.wit +// ^^^^ support.interface.wit +// ^ punctuation.separator.version.wit +// ^^^^^ constant.numeric.version.wit +// ^ punctuation.separator.path.wit +// ^ punctuation.section.sequence.begin.wit +// ^^^^^^^^ variable.other.wit +// ^ punctuation.section.sequence.end.wit +// ^ punctuation.terminator.statement.wit + /// World Declarations ////////////////////////////////////////////////////////