summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Source/DafnyExtension/IdentifierTagger.cs10
-rw-r--r--Source/DafnyExtension/OutliningTagger.cs2
2 files changed, 6 insertions, 6 deletions
diff --git a/Source/DafnyExtension/IdentifierTagger.cs b/Source/DafnyExtension/IdentifierTagger.cs
index 51f837f7..998a2d7f 100644
--- a/Source/DafnyExtension/IdentifierTagger.cs
+++ b/Source/DafnyExtension/IdentifierTagger.cs
@@ -381,7 +381,7 @@ namespace DafnyLanguage
Contract.Requires(prog != null);
Contract.Requires(tok != null);
Contract.Requires(v != null);
- if (InMainFile(prog, tok)) {
+ if (InMainFileAndUserDefined(prog, tok)) {
regions.Add(new IdRegion(tok, v, isDefinition, kind, context));
}
}
@@ -391,7 +391,7 @@ namespace DafnyLanguage
Contract.Requires(tok != null);
Contract.Requires(decl != null);
Contract.Requires(kind != null);
- if (InMainFile(prog, tok)) {
+ if (InMainFileAndUserDefined(prog, tok)) {
regions.Add(new IdRegion(tok, decl, showType, kind, isDefinition, context));
}
}
@@ -401,7 +401,7 @@ namespace DafnyLanguage
Contract.Requires(prog != null);
Contract.Requires(tok != null);
Contract.Requires(text != null);
- if (InMainFile(prog, tok)) {
+ if (InMainFileAndUserDefined(prog, tok)) {
regions.Add(new IdRegion(tok, OccurrenceKind.AdditionalInformation, text, length));
}
}
@@ -457,10 +457,10 @@ namespace DafnyLanguage
public abstract class DafnyRegion
{
- public static bool InMainFile(Microsoft.Dafny.Program prog, Bpl.IToken tok) {
+ public static bool InMainFileAndUserDefined(Microsoft.Dafny.Program prog, Bpl.IToken tok) {
Contract.Requires(prog != null);
Contract.Requires(tok != null);
- return object.Equals(prog.FullName, tok.filename);
+ return object.Equals(prog.FullName, tok.filename) && !(tok is AutoGeneratedToken);
}
}
diff --git a/Source/DafnyExtension/OutliningTagger.cs b/Source/DafnyExtension/OutliningTagger.cs
index ea611594..fc06d4bf 100644
--- a/Source/DafnyExtension/OutliningTagger.cs
+++ b/Source/DafnyExtension/OutliningTagger.cs
@@ -201,7 +201,7 @@ namespace DafnyLanguage
public static void Add(List<OutliningRegion> regions, Microsoft.Dafny.Program prog, Dafny.INamedRegion decl, string kind) {
Contract.Requires(regions != null);
Contract.Requires(prog != null);
- if (InMainFile(prog, decl.BodyStartTok)) {
+ if (InMainFileAndUserDefined(prog, decl.BodyStartTok)) {
regions.Add(new OutliningRegion(decl, kind));
}
}