Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
GregoryTravis committed Dec 17, 2024
2 parents a9bc6a2 + 30075d2 commit e2c17b6
Show file tree
Hide file tree
Showing 209 changed files with 5,271 additions and 2,347 deletions.
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ tsconfig.json

# Licenses
/distribution/engine/
/distribution/launcher/
/distribution/project-manager/
/tools/legal-review/

# The default project template is owned by the libraries team
Expand Down
26 changes: 9 additions & 17 deletions .github/workflows/gui-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,6 @@ jobs:
node-version-file: .node-version
cache: "pnpm"

- uses: actions/cache/restore@v4
name: Download cache
id: cache
with:
path: |
**/.eslintcache
node_modules/.cache/prettier
key: ${{ runner.os }}-gui-${{ github.run_id }}
restore-keys: |
${{ runner.os }}-gui
- if: startsWith(runner.name, 'GitHub Actions') || startsWith(runner.name, 'Hosted Agent')
name: Installing wasm-pack
uses: jetli/[email protected]
Expand All @@ -51,10 +40,15 @@ jobs:
- name: 📦 Install dependencies
run: pnpm install --frozen-lockfile

- name: 📝 Prettier
id: prettier
continue-on-error: true
run: pnpm run ci:prettier
- uses: actions/cache/restore@v4
name: Download cache
id: cache
with:
path: |
**/.eslintcache
key: ${{ runner.os }}-gui-${{ github.run_id }}
restore-keys: |
${{ runner.os }}-gui
# Next Tasks are depend on Typecheck, because we build libraries at this stage
- name: 🧠 Typecheck
Expand Down Expand Up @@ -88,7 +82,6 @@ jobs:
- name: ❌ Fail if any check failed
if: always() && (steps.prettier.outcome == 'failure' || steps.lint.outcome == 'failure' || steps.typecheck.outcome == 'failure' || steps.unit-tests.outcome == 'failure')
run: |
echo "Prettier outcome: ${{ steps.prettier.outcome }}"
echo "Lint outcome: ${{ steps.lint.outcome }}"
echo "Typecheck outcome: ${{ steps.typecheck.outcome }}"
echo "Unit tests outcome: ${{ steps.unit-tests.outcome }}"
Expand All @@ -102,7 +95,6 @@ jobs:
key: ${{ steps.cache.outputs.cache-primary-key }}
path: |
**/.eslintcache
node_modules/.cache/prettier
playwright:
name: 🎭 Playwright Tests
Expand Down
46 changes: 46 additions & 0 deletions .github/workflows/gui-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,52 @@ jobs:
echo "$file was changed"
done
prettier:
name: 🧹 Prettier
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: 📦 Setup pnpm
uses: pnpm/action-setup@v4

- uses: actions/setup-node@v4
name: ⎔ Setup Node
with:
node-version-file: .node-version
cache: "pnpm"

- if: startsWith(runner.name, 'GitHub Actions') || startsWith(runner.name, 'Hosted Agent')
name: Installing wasm-pack
uses: jetli/[email protected]
with:
version: v0.12.1

- name: 📦 Install dependencies
run: pnpm install --frozen-lockfile --ignore-scripts

- uses: actions/cache/restore@v4
name: Download cache
id: cache
with:
path: |
node_modules/.cache/prettier
key: ${{ runner.os }}-gui-${{ github.run_id }}
restore-keys: |
${{ runner.os }}-gui
- name: Run prettier
run: pnpm run ci:prettier

- name: 💾 Save cache
uses: actions/cache/save@v4
if: always() && steps.cache.outputs.cache-hit != 'true'
id: save-cache
with:
key: ${{ steps.cache.outputs.cache-primary-key }}
path: |
node_modules/.cache/prettier
checks:
name: 🧰 Checks
uses: ./.github/workflows/gui-checks.yml
Expand Down
3 changes: 1 addition & 2 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,11 @@ build/build/release-body.md
distribution/launcher/THIRD-PARTY
distribution/engine/THIRD-PARTY
distribution/project-manager/THIRD-PARTY
tools/legal-review
tools
distribution/lib/Standard/*/*/manifest.yaml
distribution/lib/Standard/*/*/polyglot
distribution/lib/Standard/*/*/THIRD-PARTY
distribution/docs-js
docs/**/*.md

built-distribution/
THIRD-PARTY
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@
#### Enso Language & Runtime

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

[11600]: https://github.com/enso-org/enso/pull/11600
[11856]: https://github.com/enso-org/enso/pull/11856

# Next Release

Expand Down
12 changes: 6 additions & 6 deletions app/gui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,13 @@
"@ag-grid-enterprise/range-selection": "^32.3.3",
"@babel/parser": "^7.24.7",
"babel-plugin-react-compiler": "19.0.0-beta-a7bf2bd-20241110",
"@codemirror/commands": "^6.6.0",
"@codemirror/language": "^6.10.2",
"@codemirror/commands": "^6.7.1",
"@codemirror/language": "^6.10.6",
"@codemirror/lang-markdown": "^v6.3.0",
"@codemirror/lint": "^6.8.1",
"@codemirror/search": "^6.5.6",
"@codemirror/state": "^6.4.1",
"@codemirror/view": "^6.35.0",
"@codemirror/lint": "^6.8.4",
"@codemirror/search": "^6.5.8",
"@codemirror/state": "^6.5.0",
"@codemirror/view": "^6.35.3",
"@fast-check/vitest": "^0.0.8",
"@floating-ui/vue": "^1.0.6",
"@lezer/common": "^1.1.0",
Expand Down
2 changes: 1 addition & 1 deletion app/gui/src/dashboard/hooks/projectHooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ export function useOpenProjectMutation() {
executeAsync: inBackground,
cognitoCredentials: {
accessToken: session.accessToken,
refreshToken: session.accessToken,
refreshToken: session.refreshToken,
clientId: session.clientId,
expireAt: session.expireAt,
refreshUrl: session.refreshUrl,
Expand Down
70 changes: 56 additions & 14 deletions app/gui/src/project-view/components/CodeEditor/CodeEditorImpl.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,45 +4,58 @@ import { ensoSyntax } from '@/components/CodeEditor/ensoSyntax'
import { useEnsoSourceSync } from '@/components/CodeEditor/sync'
import { ensoHoverTooltip } from '@/components/CodeEditor/tooltips'
import CodeMirrorRoot from '@/components/CodeMirrorRoot.vue'
import VueComponentHost from '@/components/VueComponentHost.vue'
import { useGraphStore } from '@/stores/graph'
import { useProjectStore } from '@/stores/project'
import { useSuggestionDbStore } from '@/stores/suggestionDatabase'
import { useAutoBlur } from '@/util/autoBlur'
import { useCodeMirror } from '@/util/codemirror'
import { highlightStyle } from '@/util/codemirror/highlight'
import { testSupport } from '@/util/codemirror/testSupport'
import { indentWithTab } from '@codemirror/commands'
import {
bracketMatching,
defaultHighlightStyle,
foldGutter,
syntaxHighlighting,
} from '@codemirror/language'
import { indentWithTab, insertNewlineKeepIndent } from '@codemirror/commands'
import { bracketMatching, foldGutter } from '@codemirror/language'
import { lintGutter } from '@codemirror/lint'
import { highlightSelectionMatches } from '@codemirror/search'
import { keymap } from '@codemirror/view'
import { type Highlighter } from '@lezer/highlight'
import { minimalSetup } from 'codemirror'
import { computed, onMounted, useTemplateRef, type ComponentInstance } from 'vue'
import {
computed,
onMounted,
toRef,
useCssModule,
useTemplateRef,
type ComponentInstance,
} from 'vue'
const projectStore = useProjectStore()
const graphStore = useGraphStore()
const suggestionDbStore = useSuggestionDbStore()
const vueComponentHost =
useTemplateRef<ComponentInstance<typeof VueComponentHost>>('vueComponentHost')
const editorRoot = useTemplateRef<ComponentInstance<typeof CodeMirrorRoot>>('editorRoot')
const rootElement = computed(() => editorRoot.value?.rootElement)
useAutoBlur(rootElement)
const autoindentOnEnter = {
key: 'Enter',
run: insertNewlineKeepIndent,
}
const vueHost = computed(() => vueComponentHost.value || undefined)
const { editorView, setExtraExtensions } = useCodeMirror(editorRoot, {
extensions: [
keymap.of([indentWithTab, autoindentOnEnter]),
minimalSetup,
syntaxHighlighting(defaultHighlightStyle as Highlighter),
bracketMatching(),
foldGutter(),
lintGutter(),
highlightSelectionMatches(),
ensoSyntax(),
ensoHoverTooltip(graphStore, suggestionDbStore),
keymap.of([indentWithTab]),
ensoSyntax(toRef(graphStore, 'moduleRoot')),
highlightStyle(useCssModule()),
ensoHoverTooltip(graphStore, suggestionDbStore, vueHost),
],
vueHost,
})
;(window as any).__codeEditorApi = testSupport(editorView)
const { updateListener, connectModuleListener } = useEnsoSourceSync(
Expand All @@ -61,6 +74,7 @@ onMounted(() => {

<template>
<CodeMirrorRoot ref="editorRoot" class="CodeEditor" @keydown.tab.stop.prevent />
<VueComponentHost ref="vueComponentHost" />
</template>

<style scoped>
Expand All @@ -73,7 +87,6 @@ onMounted(() => {
}
:deep(.cm-scroller) {
font-family: var(--font-mono);
/* Prevent touchpad back gesture, which can be triggered while panning. */
overscroll-behavior: none;
}
Expand Down Expand Up @@ -113,3 +126,32 @@ onMounted(() => {
min-width: 32px;
}
</style>

<!--suppress CssUnusedSymbol -->
<style module>
.keyword,
.moduleKeyword,
.modifier {
color: #708;
}
.number {
color: #164;
}
.string {
color: #a11;
}
.escape {
color: #e40;
}
.variableName,
.definition-variableName {
color: #00f;
}
.lineComment,
.docComment {
color: #940;
}
.invalid {
color: #f00;
}
</style>
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<script setup lang="ts">
import { type NodeId } from '@/stores/graph'
import { type GraphDb } from '@/stores/graph/graphDatabase'
import { type SuggestionDbStore } from '@/stores/suggestionDatabase'
import { computed } from 'vue'
const { nodeId, syntax, graphDb, suggestionDbStore } = defineProps<{
nodeId: NodeId | undefined
syntax: string
graphDb: GraphDb
suggestionDbStore: SuggestionDbStore
}>()
const expressionInfo = computed(() => nodeId && graphDb.getExpressionInfo(nodeId))
const typeName = computed(
() => expressionInfo.value && (expressionInfo.value.typename ?? 'Unknown'),
)
const executionTimeMs = computed(
() =>
expressionInfo.value?.profilingInfo[0] &&
(expressionInfo.value.profilingInfo[0].ExecutionTime.nanoTime / 1_000_000).toFixed(3),
)
const method = computed(() => expressionInfo.value?.methodCall?.methodPointer)
const group = computed(() => {
const id = method.value && suggestionDbStore.entries.findByMethodPointer(method.value)
if (id == null) return
const suggestionEntry = suggestionDbStore.entries.get(id)
if (!suggestionEntry) return
const groupIndex = suggestionEntry.groupIndex
if (groupIndex == null) return
const group = suggestionDbStore.groups[groupIndex]
if (!group) return
return {
name: `${group.project}.${group.name}`,
color: group.color,
}
})
</script>

<template>
<div v-if="nodeId">AST ID: {{ nodeId }}</div>
<div v-if="typeName">Type: {{ typeName }}</div>
<div v-if="executionTimeMs != null">Execution Time: {{ executionTimeMs }}ms</div>
<div>Syntax: {{ syntax }}</div>
<div v-if="method">Method: {{ method.module }}.{{ method.name }}</div>
<div v-if="group" :style="{ color: group.color }">Group: {{ group.name }}</div>
</template>
Loading

0 comments on commit e2c17b6

Please sign in to comment.