Skip to content

Commit

Permalink
added noop indent function to avoid fallback to default adaptation
Browse files Browse the repository at this point in the history
  • Loading branch information
joswig committed Oct 26, 2024
1 parent a8aff21 commit 4fb63b5
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 7 deletions.
30 changes: 29 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 11 additions & 6 deletions src/adaptation.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
import { CompletionContext, CompletionResult } from '@codemirror/autocomplete';
import { ChannelDictionary, CommandDictionary, FswCommand, ParameterDictionary } from '@nasa-jpl/aerie-ampcs';
import { ISequenceAdaptation } from './sharedTypes.js';
import type { IndentContext } from '@codemirror/language';

function identityTransform(contents: string): Promise<string> {
return Promise.resolve(contents);
}

export const SampleAdaptation: ISequenceAdaptation = {
inputFormat: {
linter: undefined,
name: 'languageName',
toInputFormat: identityTransform,
},
outputFormat: [],
autoComplete: function (
_channelDictionary: ChannelDictionary | null,
commandDictionary: CommandDictionary | null,
Expand All @@ -34,4 +29,14 @@ export const SampleAdaptation: ISequenceAdaptation = {
};
};
},
autoIndent: () => (context: IndentContext, pos: number): number | null | undefined => {
/** return the number of characters to auto indent */
return null;
},
inputFormat: {
linter: undefined,
name: 'languageName',
toInputFormat: identityTransform,
},
outputFormat: [],
};

0 comments on commit 4fb63b5

Please sign in to comment.