Skip to content

Commit 9156565

Browse files
committed
Merge pull request #20 from rainers/master
changes for 0.3.38-rc3
2 parents 20e4608 + 5aa856d commit 9156565

File tree

8 files changed

+74
-51
lines changed

8 files changed

+74
-51
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
#define VERSION_MINOR 3
33
#define VERSION_REVISION 38
44
#define VERSION_BETA -rc
5-
#define VERSION_BUILD 2
5+
#define VERSION_BUILD 3

vdc/abothe/comserver/VDServerCompletionDataGenerator.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,8 @@ public string VisitAttribute(NegatedDeclarationCondition a)
175175
#endregion
176176
}
177177

178+
public void SetSuggestedItem(string item) { }
179+
178180
/// <summary>
179181
/// Adds a node to the completion data
180182
/// </summary>

vdc/lexer.d

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1370,3 +1370,41 @@ string operatorName(int id)
13701370
assert(false);
13711371
}
13721372
}
1373+
1374+
enum case_TOKs_BasicTypeX = q{
1375+
case TOK_bool:
1376+
case TOK_byte:
1377+
case TOK_ubyte:
1378+
case TOK_short:
1379+
case TOK_ushort:
1380+
case TOK_int:
1381+
case TOK_uint:
1382+
case TOK_long:
1383+
case TOK_ulong:
1384+
case TOK_char:
1385+
case TOK_wchar:
1386+
case TOK_dchar:
1387+
case TOK_float:
1388+
case TOK_double:
1389+
case TOK_real:
1390+
case TOK_ifloat:
1391+
case TOK_idouble:
1392+
case TOK_ireal:
1393+
case TOK_cfloat:
1394+
case TOK_cdouble:
1395+
case TOK_creal:
1396+
case TOK_void:
1397+
};
1398+
1399+
enum case_TOKs_TemplateSingleArgument = q{
1400+
case TOK_Identifier:
1401+
case TOK_CharacterLiteral:
1402+
case TOK_StringLiteral:
1403+
case TOK_IntegerLiteral:
1404+
case TOK_FloatLiteral:
1405+
case TOK_true:
1406+
case TOK_false:
1407+
case TOK_null:
1408+
case TOK___FILE__:
1409+
case TOK___LINE__:
1410+
}; // + case_TOKs_BasicTypeX;

vdc/parser/decl.d

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -638,30 +638,6 @@ bool isTypeModifier(TokenId tok)
638638
// cdouble
639639
// creal
640640
// void
641-
enum case_TOKs_BasicTypeX = q{
642-
case TOK_bool:
643-
case TOK_byte:
644-
case TOK_ubyte:
645-
case TOK_short:
646-
case TOK_ushort:
647-
case TOK_int:
648-
case TOK_uint:
649-
case TOK_long:
650-
case TOK_ulong:
651-
case TOK_char:
652-
case TOK_wchar:
653-
case TOK_dchar:
654-
case TOK_float:
655-
case TOK_double:
656-
case TOK_real:
657-
case TOK_ifloat:
658-
case TOK_idouble:
659-
case TOK_ireal:
660-
case TOK_cfloat:
661-
case TOK_cdouble:
662-
case TOK_creal:
663-
case TOK_void:
664-
};
665641

666642
bool isBasicTypeX(TokenId tok)
667643
{

vdc/parser/tmpl.d

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -235,18 +235,6 @@ class TemplateArgumentList
235235
// null
236236
// __FILE__
237237
// __LINE__
238-
enum case_TOKs_TemplateSingleArgument = q{
239-
case TOK_Identifier:
240-
case TOK_CharacterLiteral:
241-
case TOK_StringLiteral:
242-
case TOK_IntegerLiteral:
243-
case TOK_FloatLiteral:
244-
case TOK_true:
245-
case TOK_false:
246-
case TOK_null:
247-
case TOK___FILE__:
248-
case TOK___LINE__:
249-
}; // case_TOKs_BasicTypeX;
250238

251239
//-- GRAMMAR_BEGIN --
252240
//TemplateTypeParameter:

visuald/completion.d

Lines changed: 32 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -430,19 +430,40 @@ class Declarations
430430

431431
if(symbols.length > 0 && mPendingSource)
432432
{
433-
if(symbols.length > 10 && mNames.length + symbols.length > 50)
433+
// split after second ':' to combine same name and type
434+
static string splitName(string name, ref string desc)
434435
{
435-
// go through assoc array for faster uniqueness check
436-
bool[string] names;
437-
foreach(n; mNames)
438-
names[n] = true;
439-
foreach(s; symbols)
440-
names[s] = true;
441-
mNames = names.keys();
436+
auto pos = name.indexOf(':');
437+
if(pos < 0)
438+
return name;
439+
pos = name.indexOf(':', pos + 1);
440+
if(pos < 0)
441+
return name;
442+
desc = name[pos..$];
443+
return name[0..pos];
442444
}
443-
else
444-
foreach(s; symbols)
445-
mNames.addunique(s);
445+
446+
// go through assoc array for faster uniqueness check
447+
string[string] names;
448+
foreach(n; mNames)
449+
{
450+
string desc;
451+
string name = splitName(n, desc);
452+
names[name] = desc;
453+
}
454+
foreach(s; symbols)
455+
{
456+
string desc;
457+
string name = splitName(s, desc);
458+
if(auto p = name in names)
459+
*p ~= "\a\a" ~ desc[1..$]; // strip ":"
460+
else
461+
names[name] = desc;
462+
}
463+
mNames.length = names.length;
464+
size_t i = 0;
465+
foreach(n, desc; names)
466+
mNames[i++] = n ~ desc;
446467

447468
sort!("icmp(a, b) < 0", SwapStrategy.stable)(mNames);
448469
mPendingSource.GetCompletionSet().Init(mPendingView, this, false);

visuald/dlangsvc.d

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ extern (C) GCStats gc_stats();
4141
}
4242

4343
import vdc.lexer;
44-
import vdc.parser.tmpl;
45-
import vdc.parser.decl;
4644
import vdc.ivdserver;
4745
static import vdc.util;
4846

0 commit comments

Comments
 (0)