Skip to content

Commit e2c17b6

Browse files
committed
merge
2 parents a9bc6a2 + 30075d2 commit e2c17b6

File tree

209 files changed

+5271
-2347
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

209 files changed

+5271
-2347
lines changed

.github/CODEOWNERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ tsconfig.json
6161

6262
# Licenses
6363
/distribution/engine/
64+
/distribution/launcher/
65+
/distribution/project-manager/
6466
/tools/legal-review/
6567

6668
# The default project template is owned by the libraries team

.github/workflows/gui-checks.yml

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,6 @@ jobs:
3131
node-version-file: .node-version
3232
cache: "pnpm"
3333

34-
- uses: actions/cache/restore@v4
35-
name: Download cache
36-
id: cache
37-
with:
38-
path: |
39-
**/.eslintcache
40-
node_modules/.cache/prettier
41-
key: ${{ runner.os }}-gui-${{ github.run_id }}
42-
restore-keys: |
43-
${{ runner.os }}-gui
44-
4534
- if: startsWith(runner.name, 'GitHub Actions') || startsWith(runner.name, 'Hosted Agent')
4635
name: Installing wasm-pack
4736
uses: jetli/[email protected]
@@ -51,10 +40,15 @@ jobs:
5140
- name: 📦 Install dependencies
5241
run: pnpm install --frozen-lockfile
5342

54-
- name: 📝 Prettier
55-
id: prettier
56-
continue-on-error: true
57-
run: pnpm run ci:prettier
43+
- uses: actions/cache/restore@v4
44+
name: Download cache
45+
id: cache
46+
with:
47+
path: |
48+
**/.eslintcache
49+
key: ${{ runner.os }}-gui-${{ github.run_id }}
50+
restore-keys: |
51+
${{ runner.os }}-gui
5852
5953
# Next Tasks are depend on Typecheck, because we build libraries at this stage
6054
- name: 🧠 Typecheck
@@ -88,7 +82,6 @@ jobs:
8882
- name: ❌ Fail if any check failed
8983
if: always() && (steps.prettier.outcome == 'failure' || steps.lint.outcome == 'failure' || steps.typecheck.outcome == 'failure' || steps.unit-tests.outcome == 'failure')
9084
run: |
91-
echo "Prettier outcome: ${{ steps.prettier.outcome }}"
9285
echo "Lint outcome: ${{ steps.lint.outcome }}"
9386
echo "Typecheck outcome: ${{ steps.typecheck.outcome }}"
9487
echo "Unit tests outcome: ${{ steps.unit-tests.outcome }}"
@@ -102,7 +95,6 @@ jobs:
10295
key: ${{ steps.cache.outputs.cache-primary-key }}
10396
path: |
10497
**/.eslintcache
105-
node_modules/.cache/prettier
10698
10799
playwright:
108100
name: 🎭 Playwright Tests

.github/workflows/gui-pull-request.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,52 @@ jobs:
5858
echo "$file was changed"
5959
done
6060
61+
prettier:
62+
name: 🧹 Prettier
63+
runs-on: ubuntu-latest
64+
steps:
65+
- uses: actions/checkout@v4
66+
67+
- name: 📦 Setup pnpm
68+
uses: pnpm/action-setup@v4
69+
70+
- uses: actions/setup-node@v4
71+
name: ⎔ Setup Node
72+
with:
73+
node-version-file: .node-version
74+
cache: "pnpm"
75+
76+
- if: startsWith(runner.name, 'GitHub Actions') || startsWith(runner.name, 'Hosted Agent')
77+
name: Installing wasm-pack
78+
uses: jetli/[email protected]
79+
with:
80+
version: v0.12.1
81+
82+
- name: 📦 Install dependencies
83+
run: pnpm install --frozen-lockfile --ignore-scripts
84+
85+
- uses: actions/cache/restore@v4
86+
name: Download cache
87+
id: cache
88+
with:
89+
path: |
90+
node_modules/.cache/prettier
91+
key: ${{ runner.os }}-gui-${{ github.run_id }}
92+
restore-keys: |
93+
${{ runner.os }}-gui
94+
95+
- name: Run prettier
96+
run: pnpm run ci:prettier
97+
98+
- name: 💾 Save cache
99+
uses: actions/cache/save@v4
100+
if: always() && steps.cache.outputs.cache-hit != 'true'
101+
id: save-cache
102+
with:
103+
key: ${{ steps.cache.outputs.cache-primary-key }}
104+
path: |
105+
node_modules/.cache/prettier
106+
61107
checks:
62108
name: 🧰 Checks
63109
uses: ./.github/workflows/gui-checks.yml

.prettierignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,11 @@ build/build/release-body.md
1111
distribution/launcher/THIRD-PARTY
1212
distribution/engine/THIRD-PARTY
1313
distribution/project-manager/THIRD-PARTY
14-
tools/legal-review
14+
tools
1515
distribution/lib/Standard/*/*/manifest.yaml
1616
distribution/lib/Standard/*/*/polyglot
1717
distribution/lib/Standard/*/*/THIRD-PARTY
1818
distribution/docs-js
19-
docs/**/*.md
2019

2120
built-distribution/
2221
THIRD-PARTY

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,12 @@
33
#### Enso Language & Runtime
44

55
- [Intersection types & type checks][11600]
6+
- A constructor or type definition with a single inline argument definition was
7+
previously allowed to use spaces in the argument definition without
8+
parentheses. [This is now a syntax error.][11856]
69

710
[11600]: https://github.com/enso-org/enso/pull/11600
11+
[11856]: https://github.com/enso-org/enso/pull/11856
812

913
# Next Release
1014

app/gui/package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,13 +92,13 @@
9292
"@ag-grid-enterprise/range-selection": "^32.3.3",
9393
"@babel/parser": "^7.24.7",
9494
"babel-plugin-react-compiler": "19.0.0-beta-a7bf2bd-20241110",
95-
"@codemirror/commands": "^6.6.0",
96-
"@codemirror/language": "^6.10.2",
95+
"@codemirror/commands": "^6.7.1",
96+
"@codemirror/language": "^6.10.6",
9797
"@codemirror/lang-markdown": "^v6.3.0",
98-
"@codemirror/lint": "^6.8.1",
99-
"@codemirror/search": "^6.5.6",
100-
"@codemirror/state": "^6.4.1",
101-
"@codemirror/view": "^6.35.0",
98+
"@codemirror/lint": "^6.8.4",
99+
"@codemirror/search": "^6.5.8",
100+
"@codemirror/state": "^6.5.0",
101+
"@codemirror/view": "^6.35.3",
102102
"@fast-check/vitest": "^0.0.8",
103103
"@floating-ui/vue": "^1.0.6",
104104
"@lezer/common": "^1.1.0",

app/gui/src/dashboard/hooks/projectHooks.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ export function useOpenProjectMutation() {
177177
executeAsync: inBackground,
178178
cognitoCredentials: {
179179
accessToken: session.accessToken,
180-
refreshToken: session.accessToken,
180+
refreshToken: session.refreshToken,
181181
clientId: session.clientId,
182182
expireAt: session.expireAt,
183183
refreshUrl: session.refreshUrl,

app/gui/src/project-view/components/CodeEditor/CodeEditorImpl.vue

Lines changed: 56 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,45 +4,58 @@ import { ensoSyntax } from '@/components/CodeEditor/ensoSyntax'
44
import { useEnsoSourceSync } from '@/components/CodeEditor/sync'
55
import { ensoHoverTooltip } from '@/components/CodeEditor/tooltips'
66
import CodeMirrorRoot from '@/components/CodeMirrorRoot.vue'
7+
import VueComponentHost from '@/components/VueComponentHost.vue'
78
import { useGraphStore } from '@/stores/graph'
89
import { useProjectStore } from '@/stores/project'
910
import { useSuggestionDbStore } from '@/stores/suggestionDatabase'
1011
import { useAutoBlur } from '@/util/autoBlur'
1112
import { useCodeMirror } from '@/util/codemirror'
13+
import { highlightStyle } from '@/util/codemirror/highlight'
1214
import { testSupport } from '@/util/codemirror/testSupport'
13-
import { indentWithTab } from '@codemirror/commands'
14-
import {
15-
bracketMatching,
16-
defaultHighlightStyle,
17-
foldGutter,
18-
syntaxHighlighting,
19-
} from '@codemirror/language'
15+
import { indentWithTab, insertNewlineKeepIndent } from '@codemirror/commands'
16+
import { bracketMatching, foldGutter } from '@codemirror/language'
2017
import { lintGutter } from '@codemirror/lint'
2118
import { highlightSelectionMatches } from '@codemirror/search'
2219
import { keymap } from '@codemirror/view'
23-
import { type Highlighter } from '@lezer/highlight'
2420
import { minimalSetup } from 'codemirror'
25-
import { computed, onMounted, useTemplateRef, type ComponentInstance } from 'vue'
21+
import {
22+
computed,
23+
onMounted,
24+
toRef,
25+
useCssModule,
26+
useTemplateRef,
27+
type ComponentInstance,
28+
} from 'vue'
2629
2730
const projectStore = useProjectStore()
2831
const graphStore = useGraphStore()
2932
const suggestionDbStore = useSuggestionDbStore()
33+
34+
const vueComponentHost =
35+
useTemplateRef<ComponentInstance<typeof VueComponentHost>>('vueComponentHost')
3036
const editorRoot = useTemplateRef<ComponentInstance<typeof CodeMirrorRoot>>('editorRoot')
3137
const rootElement = computed(() => editorRoot.value?.rootElement)
3238
useAutoBlur(rootElement)
3339
40+
const autoindentOnEnter = {
41+
key: 'Enter',
42+
run: insertNewlineKeepIndent,
43+
}
44+
45+
const vueHost = computed(() => vueComponentHost.value || undefined)
3446
const { editorView, setExtraExtensions } = useCodeMirror(editorRoot, {
3547
extensions: [
48+
keymap.of([indentWithTab, autoindentOnEnter]),
3649
minimalSetup,
37-
syntaxHighlighting(defaultHighlightStyle as Highlighter),
3850
bracketMatching(),
3951
foldGutter(),
4052
lintGutter(),
4153
highlightSelectionMatches(),
42-
ensoSyntax(),
43-
ensoHoverTooltip(graphStore, suggestionDbStore),
44-
keymap.of([indentWithTab]),
54+
ensoSyntax(toRef(graphStore, 'moduleRoot')),
55+
highlightStyle(useCssModule()),
56+
ensoHoverTooltip(graphStore, suggestionDbStore, vueHost),
4557
],
58+
vueHost,
4659
})
4760
;(window as any).__codeEditorApi = testSupport(editorView)
4861
const { updateListener, connectModuleListener } = useEnsoSourceSync(
@@ -61,6 +74,7 @@ onMounted(() => {
6174

6275
<template>
6376
<CodeMirrorRoot ref="editorRoot" class="CodeEditor" @keydown.tab.stop.prevent />
77+
<VueComponentHost ref="vueComponentHost" />
6478
</template>
6579

6680
<style scoped>
@@ -73,7 +87,6 @@ onMounted(() => {
7387
}
7488
7589
:deep(.cm-scroller) {
76-
font-family: var(--font-mono);
7790
/* Prevent touchpad back gesture, which can be triggered while panning. */
7891
overscroll-behavior: none;
7992
}
@@ -113,3 +126,32 @@ onMounted(() => {
113126
min-width: 32px;
114127
}
115128
</style>
129+
130+
<!--suppress CssUnusedSymbol -->
131+
<style module>
132+
.keyword,
133+
.moduleKeyword,
134+
.modifier {
135+
color: #708;
136+
}
137+
.number {
138+
color: #164;
139+
}
140+
.string {
141+
color: #a11;
142+
}
143+
.escape {
144+
color: #e40;
145+
}
146+
.variableName,
147+
.definition-variableName {
148+
color: #00f;
149+
}
150+
.lineComment,
151+
.docComment {
152+
color: #940;
153+
}
154+
.invalid {
155+
color: #f00;
156+
}
157+
</style>
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<script setup lang="ts">
2+
import { type NodeId } from '@/stores/graph'
3+
import { type GraphDb } from '@/stores/graph/graphDatabase'
4+
import { type SuggestionDbStore } from '@/stores/suggestionDatabase'
5+
import { computed } from 'vue'
6+
7+
const { nodeId, syntax, graphDb, suggestionDbStore } = defineProps<{
8+
nodeId: NodeId | undefined
9+
syntax: string
10+
graphDb: GraphDb
11+
suggestionDbStore: SuggestionDbStore
12+
}>()
13+
14+
const expressionInfo = computed(() => nodeId && graphDb.getExpressionInfo(nodeId))
15+
const typeName = computed(
16+
() => expressionInfo.value && (expressionInfo.value.typename ?? 'Unknown'),
17+
)
18+
const executionTimeMs = computed(
19+
() =>
20+
expressionInfo.value?.profilingInfo[0] &&
21+
(expressionInfo.value.profilingInfo[0].ExecutionTime.nanoTime / 1_000_000).toFixed(3),
22+
)
23+
const method = computed(() => expressionInfo.value?.methodCall?.methodPointer)
24+
const group = computed(() => {
25+
const id = method.value && suggestionDbStore.entries.findByMethodPointer(method.value)
26+
if (id == null) return
27+
const suggestionEntry = suggestionDbStore.entries.get(id)
28+
if (!suggestionEntry) return
29+
const groupIndex = suggestionEntry.groupIndex
30+
if (groupIndex == null) return
31+
const group = suggestionDbStore.groups[groupIndex]
32+
if (!group) return
33+
return {
34+
name: `${group.project}.${group.name}`,
35+
color: group.color,
36+
}
37+
})
38+
</script>
39+
40+
<template>
41+
<div v-if="nodeId">AST ID: {{ nodeId }}</div>
42+
<div v-if="typeName">Type: {{ typeName }}</div>
43+
<div v-if="executionTimeMs != null">Execution Time: {{ executionTimeMs }}ms</div>
44+
<div>Syntax: {{ syntax }}</div>
45+
<div v-if="method">Method: {{ method.module }}.{{ method.name }}</div>
46+
<div v-if="group" :style="{ color: group.color }">Group: {{ group.name }}</div>
47+
</template>

0 commit comments

Comments
 (0)