For example the test:

test variable usage [[
  int32 [[x]] = 1;
  int32 y = [[x]] + 1;
]] resolve #2 to #1

Succeeds, but if you use [[ x ]] instead (with spaces around the x), the marker cannot be resolved.

I believe it's because this https://github.com/metaborg/spt/blob/new-spoofax-plugin/org.metaborg.meta.lang.spt/editor/java/org/metaborg/meta/lang/spt/strategies/SelectionFetcher.java#L101-L103 condition matches the exact offset. For example the Matches starts at location 159, but the AST term starts at 160.

I believe the whitespace was ignored in spoofax 1.4. Naively ignoring the layout is probably not what you want, as some languages have significant whitespace.

Eclipse: org.eclipse.epp.package.standard.feature.feature.group 4.4.2.20150219-0708
Spoofax: org.metaborg.spoofax.eclipse 1.5.0.20151125-144048-new-spoofax-plugin
System: Linux amd64 3.13.0-68-generic

Submitted by Arian on 27 November 2015 at 13:00

On 27 November 2015 at 16:38 Arian commented:

The same applies for parenthesis that are defined in the syntax as {bracket}.

For example:

context-free syntax

  // expression
  Expr =
    <(<Expr>)> {bracket}

With the SPT test:

test foo [[
  int x = [[(0)]];
]] 

results in the error "Could not resolve this selection."


On 27 November 2015 at 16:49 Gabriël Konat commented:

That implementation seems wrong. The tracing service in Spoofax Core should be used instead, it will find the deepest term that is contained in given region.


On 1 December 2015 at 15:31 Gabriël Konat tagged spt

On 12 January 2016 at 10:23 Gabriël Konat moved this issue to issue 9 on project SPTWithCore

On 12 January 2016 at 10:23 Gabriël Konat closed this issue.

Log in to post comments