Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(nodes-base): Multiline autocompletion for code-node-editor #4220

Merged

Conversation

ivov
Copy link
Contributor

@ivov ivov commented Sep 28, 2022

No description provided.

@ivov ivov changed the title Multiline autocompletion for client linter feat(nodes-base): Multiline autocompletion for code-node-editor Sep 28, 2022
@n8n-assistant n8n-assistant bot added n8n team Authored by the n8n team ui Enhancement in /editor-ui or /design-system labels Sep 28, 2022
@ivov ivov merged commit 63f9594 into n8n-4390-create-code-node Sep 30, 2022
@ivov ivov deleted the multiline-autocompletion-for-client-linter branch September 30, 2022 09:56
ivov added a commit that referenced this pull request Oct 13, 2022
* Introduce node deprecation (#3930)

:sparkles: Introduce node deprecation

* :construction: Scaffold out Code node

* :shirt: Fix lint

* :blue_book: Create types file

* :truck: Rename theme

* :fire: Remove unneeded prop

* :zap: Override keybindings

* :zap: Expand lintings

* :zap: Create editor content getter

* :truck: Ensure all helpers use `$`

* :sparkles: Add autocompletion

* :zap: Filter out welcome note node

* :zap: Convey error line number

* :zap: Highlight error line

* :zap: Restore logging from node

* :sparkles: More autocompletions

* :zap: Streamline completions

* :pencil2: Update placeholders

* :zap: Update linter to new methods

* :fire: Remove `$nodeItem` completions

* :zap: Re-update placeholders

* :art: Fix formatting

* :package: Update `package-lock.json`

* :zap: Refresh with multi-line empty string

* :zap: Account for syntax errors

* :fire: Remove unneeded variant

* :zap: Minor improvements

* :zap: Add more autocompletions

* :truck: Rename extension

* :fire: Remove outdated comments

* :truck: Rename field

* :sparkles: More autocompletions

* :zap: Fix up error display when empty text

* :fire: Remove logging

* :sparkles: More error validation

* :bug: Fix `pairedItem` to `pairedItem()`

* :zap: Add item to validation info

* :package: Update `package-lock.json`

* :zap: Leftover fixes

* :zap: Set `insertNewlineAndIndent`

* :package: Update `package-lock.json`

* :package: Re-update `package-lock.json`

* :shirt: Add lint exception

* :blue_book: Add type to mixin type

* Clean up comment

* :zap: Refactor completion per new requirements

* :zap: Adjust placeholders

* :zap: Add `json` autocompletions for `$input`

* :art: Set border

* :zap: Restore local completion source

* :zap: Implement autocompletion for imports

* :zap: Add `.*` to follow user typing on autocompletion

* :blue_book: Fix typings in autocompletions

* :shirt: Add linting for use of `item()`

* :package: Update `package-lock.json`

* :bug: Fix for `$items(nodeName)[0]`

* :zap: Filter down built-in modules list

* :zap: Refactor error handling

* :zap: Linter and validation improvements

* :zap: Apply review feedback

* :recycle: More general refactorings

* :zap: Add dot notation utility

* Customize input handler

* :zap: Support `.json.` completions

* :zap: Adjust placeholder

* :zap: Sort imports

* :fire: Remove blank rows addition

* :zap: Add more error validation

* :package: Update `package-lock.json`

* :zap: Make date logging consistent

* :wrench: Adjust linting highlight range

* :zap: Add line numbers to each item mode errors

* :zap: Allow for links in error descriptions

* :zap: More input validation

* :zap: Expand linting to loops

* :zap: Deprecate Function and Function Item nodes

* :bug: Fix placeholder syntax

* :blue_book: Narrow down type

* :truck: Rename using kebab-case

* :fire: Remove `mapGetters`

* :pencil2: Fix casing

* :zap: Adjust import for type

* :pencil2: Fix quotes

* :bug: Fix `activeNode` reference

* :zap: Use constant

* :fire: Remove logging

* :pencil2: Fix typo

* :zap: Add missing `notice`

* :pencil2: Add tags

* :pencil2: Fix alias

* :pencil2: Update copy

* :fire: Remove wrong linting

* :pencil2: Update copy

* :zap: Add validation for `null`

* :zap: Add validation for non-object and non-array

* :zap: Add validation for non-array with json

* :pencil2: Intentionally use wrong spelling

* :zap: More validation

* :pencil2: More copy updates

* :pencil2: Placeholder updates

* :rewind: Restore spelling

* :zap: Fix var name

* :pencil2: More copy updates

* :zap: Add luxon autocompletions

* :zap: Make scrollable

* :zap: Fix comma from merge conflict resolution

* :package: Update `package-lock.json`

* :shirt: Fix lint detail

* :art: Set font family

* :zap: Bring in expressions fix

* :recycle: Address feedback

* :zap: Exclude codemirror packages from render chunks

* :bug: Fix placeholder not showing on first load

* feat(editor-ui): Replace `lezer` with `esprima` in client linter (#4192)

* 🔥 Remove addition from misresolved conflict

* ⚡ Replace `lezer` with `esprima` in client linter

* ⚡ Add missing key

* 📦 Update `package-lock.json`

* ⚡ Match dependencies

* 📦 Update `package-lock.json`

* 📦 Re-update `package-lock.json`

* ⚡ Match whitespace

* 🐛 Fix selection

* ⚡ Expand validation

* 🔥 Remove validation

* ✏️ Update copy

* 🚚 Move to constants

* ⚡ More `null` validation

* ⚡ Support `all()` with index to access item

* ⚡ Gloss over n8n syntax error

* 🎨 Re-style diagnostic button

* 🔥 Remove `item` as `itemAlias`

* ⚡ Add linting for `item.json` in single item mode

* ⚡ Refactor to add label info descriptions

* ⚡ More autocompletions

* 👕 Fix lint

* ⚡ Simplify typings

* feat(nodes-base): Multiline autocompletion for `code-node-editor` (#4220)

* ⚡ Simplify typings

* ⚡ Consolidate helpers in utils

* ⚡ Multiline autocompletion for standalone vars

* 🔥 Remove unneeded mixins

* ✏️ Update copy

* ✏️ Prep TODOs

* ⚡ Multiline completion for `$input.method` + `$input.item`

* 🔥 Remove unused method

* 🔥 Remove another unused method

* 🚚 Move luxon strings to helpers

* ⚡ Multiline autocompletion for methods output

* ⚡ Refactor to use optional chaining

* 👕 Fix lint

* ✏️ Update TODOs

* ⚡ Multiline autocompletion for `json` fields

* 📘 Add typings

* ⚡ De-duplicate callback to forEach

* 🐛 Fix autocompletions not working with leading whitespace

* 🌐 Apply i18n

* 👕 Fix lint

* :constructor: Second-period var usage completions

* 👕 Fix lint

* 👕 Add exception

* ⚡ Add completion telemetry

* 📘 Add typing

* ⚡ Major refactoring to organize

* 🐛 Fix multiline `.all()[index]`

* 🐛 Do not autoclose square brackets prior to `.json`

* 🐛 Fix accessor for multiline `jsonField` completions

* ⚡ Add completions for half-assignments

* 🐛 Fix `jsonField` completions for `x.json`

* ✏️ Improve comments

* 🐛 Fix `.json[field]` for multiline matches

* ⚡ Cleanup

* 📦 Update `package-lock.json`

* 👕 Fix lint

* 🐛 Rely on original value for custom matcher

* ⚡ Create `customMatcherJsonFieldCompletions` to simplify setup

* 🐛 Include selector in `customMatcherJsonField` completions

* ✏️ Make naming consistent

* ✏️ Add docline

* ⚡ Finish self-review cleanup

* 🔥 Remove outdated comment

* 📌 Pin luxon to major-minor

* ✏️ Fix typo

* 📦 Update `package-lock.json`

* 📦 Update `package-lock.json`

* 📦 Re-update `package-lock.json`

* ➕ Add `luxon` for Gmail node

* 📦 Update `package-lock.json`

* ⚡ Replace Function with Code in suggested nodes

* 🐛 Fix `$prevNode` completions

* ✏️ Update `$execution.mode` copy

* ⚡ Separate luxon getters from methods

* ⚡ Adjusting linter to tolerate `.binary`

* ⚡ Adjust top-level item keys check

* ⚡ Anticipate user expecting `item` to pre-exist

* ⚡ Add linting for legacy item access

* ⚡ Add hint for attempted `items` access

* ⚡ Add keybinding for toggling comments

* ✏️ Update copy of `all`, `first`, `last` and `itemMatching`

* 🐛 Make `input.all()` etc act on copies

* 📦 Update `package-lock.json`

* 🐛 Fix guard in `$input.last()`

* ♻️ Address Jan's feedback

* ⬆️ Upgrade `eslint-plugin-n8n-nodes-base`

* 📦 Update `package-lock.json`

* 🔥 Remove unneeded exceptions

* ⚡ Restore placeholder logic

* ⚡ Add placeholders to client

* ⚡ Account for shadow item

* ✏️ More completion info labels

* 👕 Fix lint

* ✏️ Update copy

* ✏️ Update copy

* ✏️ More copy updates

* 📦 Update `package-lock.json`

* ⚡ Add more validation

* ⚡ Add placheolder on first load

* Replace `Cmd` with `Mod`

* 📦 Update `package-lock.json`
valya pushed a commit to valya/n8n that referenced this pull request Nov 8, 2022
* Introduce node deprecation (n8n-io#3930)

:sparkles: Introduce node deprecation

* :construction: Scaffold out Code node

* :shirt: Fix lint

* :blue_book: Create types file

* :truck: Rename theme

* :fire: Remove unneeded prop

* :zap: Override keybindings

* :zap: Expand lintings

* :zap: Create editor content getter

* :truck: Ensure all helpers use `$`

* :sparkles: Add autocompletion

* :zap: Filter out welcome note node

* :zap: Convey error line number

* :zap: Highlight error line

* :zap: Restore logging from node

* :sparkles: More autocompletions

* :zap: Streamline completions

* :pencil2: Update placeholders

* :zap: Update linter to new methods

* :fire: Remove `$nodeItem` completions

* :zap: Re-update placeholders

* :art: Fix formatting

* :package: Update `package-lock.json`

* :zap: Refresh with multi-line empty string

* :zap: Account for syntax errors

* :fire: Remove unneeded variant

* :zap: Minor improvements

* :zap: Add more autocompletions

* :truck: Rename extension

* :fire: Remove outdated comments

* :truck: Rename field

* :sparkles: More autocompletions

* :zap: Fix up error display when empty text

* :fire: Remove logging

* :sparkles: More error validation

* :bug: Fix `pairedItem` to `pairedItem()`

* :zap: Add item to validation info

* :package: Update `package-lock.json`

* :zap: Leftover fixes

* :zap: Set `insertNewlineAndIndent`

* :package: Update `package-lock.json`

* :package: Re-update `package-lock.json`

* :shirt: Add lint exception

* :blue_book: Add type to mixin type

* Clean up comment

* :zap: Refactor completion per new requirements

* :zap: Adjust placeholders

* :zap: Add `json` autocompletions for `$input`

* :art: Set border

* :zap: Restore local completion source

* :zap: Implement autocompletion for imports

* :zap: Add `.*` to follow user typing on autocompletion

* :blue_book: Fix typings in autocompletions

* :shirt: Add linting for use of `item()`

* :package: Update `package-lock.json`

* :bug: Fix for `$items(nodeName)[0]`

* :zap: Filter down built-in modules list

* :zap: Refactor error handling

* :zap: Linter and validation improvements

* :zap: Apply review feedback

* :recycle: More general refactorings

* :zap: Add dot notation utility

* Customize input handler

* :zap: Support `.json.` completions

* :zap: Adjust placeholder

* :zap: Sort imports

* :fire: Remove blank rows addition

* :zap: Add more error validation

* :package: Update `package-lock.json`

* :zap: Make date logging consistent

* :wrench: Adjust linting highlight range

* :zap: Add line numbers to each item mode errors

* :zap: Allow for links in error descriptions

* :zap: More input validation

* :zap: Expand linting to loops

* :zap: Deprecate Function and Function Item nodes

* :bug: Fix placeholder syntax

* :blue_book: Narrow down type

* :truck: Rename using kebab-case

* :fire: Remove `mapGetters`

* :pencil2: Fix casing

* :zap: Adjust import for type

* :pencil2: Fix quotes

* :bug: Fix `activeNode` reference

* :zap: Use constant

* :fire: Remove logging

* :pencil2: Fix typo

* :zap: Add missing `notice`

* :pencil2: Add tags

* :pencil2: Fix alias

* :pencil2: Update copy

* :fire: Remove wrong linting

* :pencil2: Update copy

* :zap: Add validation for `null`

* :zap: Add validation for non-object and non-array

* :zap: Add validation for non-array with json

* :pencil2: Intentionally use wrong spelling

* :zap: More validation

* :pencil2: More copy updates

* :pencil2: Placeholder updates

* :rewind: Restore spelling

* :zap: Fix var name

* :pencil2: More copy updates

* :zap: Add luxon autocompletions

* :zap: Make scrollable

* :zap: Fix comma from merge conflict resolution

* :package: Update `package-lock.json`

* :shirt: Fix lint detail

* :art: Set font family

* :zap: Bring in expressions fix

* :recycle: Address feedback

* :zap: Exclude codemirror packages from render chunks

* :bug: Fix placeholder not showing on first load

* feat(editor-ui): Replace `lezer` with `esprima` in client linter (n8n-io#4192)

* 🔥 Remove addition from misresolved conflict

* ⚡ Replace `lezer` with `esprima` in client linter

* ⚡ Add missing key

* 📦 Update `package-lock.json`

* ⚡ Match dependencies

* 📦 Update `package-lock.json`

* 📦 Re-update `package-lock.json`

* ⚡ Match whitespace

* 🐛 Fix selection

* ⚡ Expand validation

* 🔥 Remove validation

* ✏️ Update copy

* 🚚 Move to constants

* ⚡ More `null` validation

* ⚡ Support `all()` with index to access item

* ⚡ Gloss over n8n syntax error

* 🎨 Re-style diagnostic button

* 🔥 Remove `item` as `itemAlias`

* ⚡ Add linting for `item.json` in single item mode

* ⚡ Refactor to add label info descriptions

* ⚡ More autocompletions

* 👕 Fix lint

* ⚡ Simplify typings

* feat(nodes-base): Multiline autocompletion for `code-node-editor` (n8n-io#4220)

* ⚡ Simplify typings

* ⚡ Consolidate helpers in utils

* ⚡ Multiline autocompletion for standalone vars

* 🔥 Remove unneeded mixins

* ✏️ Update copy

* ✏️ Prep TODOs

* ⚡ Multiline completion for `$input.method` + `$input.item`

* 🔥 Remove unused method

* 🔥 Remove another unused method

* 🚚 Move luxon strings to helpers

* ⚡ Multiline autocompletion for methods output

* ⚡ Refactor to use optional chaining

* 👕 Fix lint

* ✏️ Update TODOs

* ⚡ Multiline autocompletion for `json` fields

* 📘 Add typings

* ⚡ De-duplicate callback to forEach

* 🐛 Fix autocompletions not working with leading whitespace

* 🌐 Apply i18n

* 👕 Fix lint

* :constructor: Second-period var usage completions

* 👕 Fix lint

* 👕 Add exception

* ⚡ Add completion telemetry

* 📘 Add typing

* ⚡ Major refactoring to organize

* 🐛 Fix multiline `.all()[index]`

* 🐛 Do not autoclose square brackets prior to `.json`

* 🐛 Fix accessor for multiline `jsonField` completions

* ⚡ Add completions for half-assignments

* 🐛 Fix `jsonField` completions for `x.json`

* ✏️ Improve comments

* 🐛 Fix `.json[field]` for multiline matches

* ⚡ Cleanup

* 📦 Update `package-lock.json`

* 👕 Fix lint

* 🐛 Rely on original value for custom matcher

* ⚡ Create `customMatcherJsonFieldCompletions` to simplify setup

* 🐛 Include selector in `customMatcherJsonField` completions

* ✏️ Make naming consistent

* ✏️ Add docline

* ⚡ Finish self-review cleanup

* 🔥 Remove outdated comment

* 📌 Pin luxon to major-minor

* ✏️ Fix typo

* 📦 Update `package-lock.json`

* 📦 Update `package-lock.json`

* 📦 Re-update `package-lock.json`

* ➕ Add `luxon` for Gmail node

* 📦 Update `package-lock.json`

* ⚡ Replace Function with Code in suggested nodes

* 🐛 Fix `$prevNode` completions

* ✏️ Update `$execution.mode` copy

* ⚡ Separate luxon getters from methods

* ⚡ Adjusting linter to tolerate `.binary`

* ⚡ Adjust top-level item keys check

* ⚡ Anticipate user expecting `item` to pre-exist

* ⚡ Add linting for legacy item access

* ⚡ Add hint for attempted `items` access

* ⚡ Add keybinding for toggling comments

* ✏️ Update copy of `all`, `first`, `last` and `itemMatching`

* 🐛 Make `input.all()` etc act on copies

* 📦 Update `package-lock.json`

* 🐛 Fix guard in `$input.last()`

* ♻️ Address Jan's feedback

* ⬆️ Upgrade `eslint-plugin-n8n-nodes-base`

* 📦 Update `package-lock.json`

* 🔥 Remove unneeded exceptions

* ⚡ Restore placeholder logic

* ⚡ Add placeholders to client

* ⚡ Account for shadow item

* ✏️ More completion info labels

* 👕 Fix lint

* ✏️ Update copy

* ✏️ Update copy

* ✏️ More copy updates

* 📦 Update `package-lock.json`

* ⚡ Add more validation

* ⚡ Add placheolder on first load

* Replace `Cmd` with `Mod`

* 📦 Update `package-lock.json`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
n8n team Authored by the n8n team ui Enhancement in /editor-ui or /design-system
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant