Skip to content

Commit 7c776a2

Browse files
committed
Several fixes/improvements.
1 parent a7b7b02 commit 7c776a2

11 files changed

+148
-1
lines changed

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Change Log
22

3+
## v1.1.27
4+
- Fix `var` keyword and types in some special contexts in C# razor.
5+
- Fix TypeScript template expressions.
6+
- Fix some keywords in PHP (`namespace`, `use`, `new` and possibly others).
7+
- Use special highlighting for functions like echo in PHP.
8+
39
## v1.1.26
410
- Fix latex keywords, operators and character constants.
511
- Fix rust bool literals.

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Contains several color variants:
1010
- Yellow
1111
- Cyan
1212
- Magenta
13+
- Kumuhana
1314

1415
## How it looks
1516
The yellow version (My favourite)

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "typedark",
33
"displayName": "TypeDark",
44
"description": "Dark theme with useful semantic highlighting.",
5-
"version": "1.1.26",
5+
"version": "1.1.27",
66
"icon": "images/icon.png",
77
"repository": {
88
"url": "https://github.com/BonnyAD9/TypeDark"

test-files/main.js

+47
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import "";
2+
import DatePicker from "react-date-picker";
3+
import 'react-date-picker/dist/DatePicker.css'
24

35
class FSItem {
46
/** @type {Path} */
@@ -62,3 +64,48 @@ function createFile(dir, name) {
6264
};
6365
return dir.value[name];
6466
}
67+
68+
function DateInput(props) {
69+
const onChange = (e) => {
70+
// one way of handling the input change, set new value to the data the
71+
// caller has passed
72+
if (props.data) {
73+
props.data.setData({
74+
...props.data.data,
75+
[props.name]: e,
76+
});
77+
}
78+
79+
// second way of handling the input change: event
80+
if (props.onChange) {
81+
props.onChange({ target: { value: e, name: props.name } });
82+
}
83+
};
84+
85+
const onBlur = (e) => {
86+
// one way of handling the input save, set new value to the data the
87+
// caller has passed
88+
if (props.save) {
89+
props.save(props.data.data);
90+
}
91+
92+
// second way of handling the input save: event
93+
if (props.onBlur) {
94+
if (!e.target.parentElement.parentElement.matches(":focus-within"))
95+
{
96+
props.onBlur({target: { name: props.name }});
97+
}
98+
}
99+
};
100+
101+
return <DatePicker
102+
calendarIcon={null}
103+
clearIcon={null}
104+
disableCalendar
105+
className="date-picker"
106+
format={props.format ? props.format : "dd.MM.yyyy"}
107+
onChange={onChange}
108+
onBlur={onBlur}
109+
value={props.data ? props.data.data[props.name] : props.value}
110+
/>
111+
}

test-files/main.php

+11
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
<?php
22

3+
namespace App;
4+
use App;
5+
36
$rules = [];
47

58
while (true) {
@@ -93,3 +96,11 @@ function swap(mixed &$a, mixed &$b) {
9396
$a = $b;
9497
$b = $h;
9598
}
99+
100+
class SomeClass {
101+
public function __construct() {
102+
echo "lol";
103+
}
104+
}
105+
106+
$lol = new SomeClass();

test-files/main.razor

+46
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,49 @@
1414
count++;
1515
}
1616
}
17+
18+
@page "/roles"
19+
@using System.Security.Claims
20+
@inject AuthenticationStateProvider AuthenticationStateProvider
21+
22+
<h1>ClaimsPrincipal Data</h1>
23+
24+
<button @onclick="GetClaimsPrincipalData">Get ClaimsPrincipal Data</button>
25+
26+
<p>@authMessage</p>
27+
28+
@if (claims.Any())
29+
{
30+
<ul>
31+
@foreach (var claim in claims)
32+
{
33+
<li>@claim.Type: @claim.Value</li>
34+
}
35+
</ul>
36+
}
37+
38+
<p>@surname</p>
39+
40+
@code {
41+
private string? authMessage;
42+
private string? surname;
43+
private IEnumerable<Claim> claims = Enumerable.Empty<Claim>();
44+
45+
private async Task GetClaimsPrincipalData()
46+
{
47+
var authState = await AuthenticationStateProvider
48+
.GetAuthenticationStateAsync();
49+
var user = authState.User;
50+
51+
if (user.Identity is not null && user.Identity.IsAuthenticated)
52+
{
53+
authMessage = $"{user.Identity.Name} is authenticated.";
54+
claims = user.Claims;
55+
surname = user.FindFirst(c => c.Type == ClaimTypes.Surname)?.Value;
56+
}
57+
else
58+
{
59+
authMessage = "The user is NOT authenticated.";
60+
}
61+
}
62+
}

test-files/main.ts

+16
Original file line numberDiff line numberDiff line change
@@ -95,3 +95,19 @@ function svgPreviewHTML(file: vscode.TextDocument) {
9595
function HTML(content: string, head?: string) {
9696
return `...`;
9797
}
98+
99+
export function useEvents(filters: any) {
100+
let filtersStr = '';
101+
if (filters) {
102+
if (filters.get('datum') === 'vse') {
103+
filtersStr += 'date=all'
104+
} else if (filters.get('datum') === 'probehle') {
105+
filtersStr += 'date=past';
106+
} else {
107+
filtersStr += 'date=upcoming';
108+
}
109+
if (filters.has('misto')) {
110+
filtersStr += `&place=${filters.get('misto')}`;
111+
}
112+
}
113+
}

themes/TypeDark-cyan-color-theme.json

+5
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,7 @@
283283
"source.c keyword.other",
284284
"source.shell keyword.control",
285285
"source.php keyword.control",
286+
"source.php keyword.other",
286287
"source.oraclesql keyword.control",
287288
"source.zig keyword.control",
288289
"source.js keyword.control",
@@ -318,6 +319,7 @@
318319
"keyword.language",
319320
"source.rust variable.language",
320321
"entity.name.function.macro.rules.rust",
322+
"keyword.other.var.cs",
321323
],
322324
"settings": {
323325
"foreground": "#4c8dff",
@@ -463,6 +465,7 @@
463465
"entity.name.command.shell",
464466
"meta.class support.function.constructor",
465467
"entity.other.inherited-class.php",
468+
"text.aspnetcorerazor entity.name.type.cs",
466469
],
467470
"settings": {
468471
"foreground": "#28c3cc"
@@ -511,6 +514,7 @@
511514
"scope": [
512515
"meta.interpolation",
513516
"meta.template.expression.js",
517+
"meta.template.expression.ts",
514518
"variable.parameter.label.asm",
515519
"support.class.math.block",
516520
"entity.name.type.namespace punctuation.separator.inheritance",
@@ -695,6 +699,7 @@
695699
"variable.source.cmake",
696700
"variable.language.nawk",
697701
"variable.language.awk",
702+
"source.php support.function.construct",
698703
],
699704
"settings": {
700705
"foreground": "#e2ccff",

themes/TypeDark-kumuhana-color-theme.json

+5
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,7 @@
249249
"source.c keyword.other",
250250
"source.shell keyword.control",
251251
"source.php keyword.control",
252+
"source.php keyword.other",
252253
"source.oraclesql keyword.control",
253254
"source.zig keyword.control",
254255
"source.js keyword.control",
@@ -284,6 +285,7 @@
284285
"keyword.language",
285286
"source.rust variable.language",
286287
"entity.name.function.macro.rules.rust",
288+
"keyword.other.var.cs",
287289
],
288290
"settings": {
289291
"foreground": "#4c8dff",
@@ -429,6 +431,7 @@
429431
"entity.name.command.shell",
430432
"meta.class support.function.constructor",
431433
"entity.other.inherited-class.php",
434+
"text.aspnetcorerazor entity.name.type.cs",
432435
],
433436
"settings": {
434437
"foreground": "#28c3cc"
@@ -477,6 +480,7 @@
477480
"scope": [
478481
"meta.interpolation",
479482
"meta.template.expression.js",
483+
"meta.template.expression.ts",
480484
"variable.parameter.label.asm",
481485
"support.class.math.block",
482486
"entity.name.type.namespace punctuation.separator.inheritance",
@@ -661,6 +665,7 @@
661665
"variable.source.cmake",
662666
"variable.language.nawk",
663667
"variable.language.awk",
668+
"source.php support.function.construct",
664669
],
665670
"settings": {
666671
"foreground": "#e2ccff",

themes/TypeDark-magenta-color-theme.json

+5
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,7 @@
291291
"source.c keyword.other",
292292
"source.shell keyword.control",
293293
"source.php keyword.control",
294+
"source.php keyword.other",
294295
"source.oraclesql keyword.control",
295296
"source.zig keyword.control",
296297
"source.js keyword.control",
@@ -326,6 +327,7 @@
326327
"keyword.language",
327328
"source.rust variable.language",
328329
"entity.name.function.macro.rules.rust",
330+
"keyword.other.var.cs",
329331
],
330332
"settings": {
331333
"foreground": "#4c8dff",
@@ -471,6 +473,7 @@
471473
"entity.name.command.shell",
472474
"meta.class support.function.constructor",
473475
"entity.other.inherited-class.php",
476+
"text.aspnetcorerazor entity.name.type.cs",
474477
],
475478
"settings": {
476479
"foreground": "#28c3cc"
@@ -519,6 +522,7 @@
519522
"scope": [
520523
"meta.interpolation",
521524
"meta.template.expression.js",
525+
"meta.template.expression.ts",
522526
"variable.parameter.label.asm",
523527
"support.class.math.block",
524528
"entity.name.type.namespace punctuation.separator.inheritance",
@@ -703,6 +707,7 @@
703707
"variable.source.cmake",
704708
"variable.language.nawk",
705709
"variable.language.awk",
710+
"source.php support.function.construct",
706711
],
707712
"settings": {
708713
"foreground": "#e2ccff",

themes/TypeDark-yellow-color-theme.json

+5
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,7 @@
283283
"source.c keyword.other",
284284
"source.shell keyword.control",
285285
"source.php keyword.control",
286+
"source.php keyword.other",
286287
"source.oraclesql keyword.control",
287288
"source.zig keyword.control",
288289
"source.js keyword.control",
@@ -318,6 +319,7 @@
318319
"keyword.language",
319320
"source.rust variable.language",
320321
"entity.name.function.macro.rules.rust",
322+
"keyword.other.var.cs",
321323
],
322324
"settings": {
323325
"foreground": "#4c8dff",
@@ -463,6 +465,7 @@
463465
"entity.name.command.shell",
464466
"meta.class support.function.constructor",
465467
"entity.other.inherited-class.php",
468+
"text.aspnetcorerazor entity.name.type.cs",
466469
],
467470
"settings": {
468471
"foreground": "#28c3cc"
@@ -511,6 +514,7 @@
511514
"scope": [
512515
"meta.interpolation",
513516
"meta.template.expression.js",
517+
"meta.template.expression.ts",
514518
"variable.parameter.label.asm",
515519
"support.class.math.block",
516520
"entity.name.type.namespace punctuation.separator.inheritance",
@@ -695,6 +699,7 @@
695699
"variable.source.cmake",
696700
"variable.language.nawk",
697701
"variable.language.awk",
702+
"source.php support.function.construct",
698703
],
699704
"settings": {
700705
"foreground": "#e2ccff",

0 commit comments

Comments
 (0)