Skip to content

Commit b8a85d1

Browse files
ejfastingCopilot
andauthored
Removed barrel imports as these create issues when compiling/building… (#26)
* Removed barrel imports as these create issues when compiling/building. Refactored some minor return types * Update packages/superofficedx-vscode-core/src/commands/implementations/script/viewDetails.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update packages/superofficedx-vscode-core/src/commands/implementations/script/executeLocally.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update packages/superofficedx-vscode-core/src/commands/implementations/script/execute.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update packages/superofficedx-vscode-core/src/commands/implementations/script/downloadFolder.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update packages/superofficedx-vscode-core/src/commands/implementations/script/preview.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update packages/superofficedx-vscode-core/src/commands/implementations/script/download.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent ca02a82 commit b8a85d1

Some content is hidden

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

46 files changed

+143
-172
lines changed

packages/crmscript-language-server

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Subproject commit be9bd2ad00715495c92299730f06216de76c10fd

packages/langium-crmscript/src/language/crmscript-validator.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { isBooleanType, isEnumMemberType, TypeDescription, typeToString } from '
88
/**
99
* Register custom validation checks.
1010
*/
11-
export function registerValidationChecks(services: CrmscriptServices) {
11+
export function registerValidationChecks(services: CrmscriptServices): void {
1212
const registry = services.validation.ValidationRegistry;
1313
const validator = services.validation.CrmscriptValidator;
1414
const checks: ValidationChecks<CrmscriptAstType> = {
@@ -56,7 +56,7 @@ export class CrmscriptValidator {
5656
}
5757
}
5858

59-
checkConstructorCallType(call: ConstructorCall, accept: ValidationAcceptor) {
59+
checkConstructorCallType(call: ConstructorCall, accept: ValidationAcceptor): void {
6060
const typeDecl = call.type?.ref;
6161
if (!typeDecl || !isClass(typeDecl)) return;
6262

@@ -75,7 +75,7 @@ export class CrmscriptValidator {
7575
}
7676
}
7777

78-
checkMemberCallParameters(memberCall: MemberCall, accept: ValidationAcceptor) {
78+
checkMemberCallParameters(memberCall: MemberCall, accept: ValidationAcceptor): void {
7979

8080
const methodMember = memberCall.element?.ref as MethodMember;
8181
if (!methodMember) return;
@@ -163,7 +163,7 @@ export class CrmscriptValidator {
163163
}
164164

165165
checkUniqueVariableName(grammar: Grammar, accept: ValidationAcceptor): void {
166-
const extractor = (grammar: Grammar) => stream(grammar.types);
166+
const extractor = (grammar: Grammar): Stream<NamedAstNode> => stream(grammar.types);
167167
this.checkUniqueName(grammar, accept, extractor, 'type');
168168
}
169169

packages/language-server/src/languagePlugin.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,23 @@ import { LanguageService, LanguageType } from './languageService.js';
1212

1313
export function getLanguagePlugin(): LanguagePlugin<URI, TsfsoVirtualCode> {
1414
return {
15-
getLanguageId(uri) {
15+
getLanguageId(uri): string | undefined {
1616
if (uri.path.endsWith('.tsfso')) {
1717
return 'tsfso';
1818
}
1919
},
2020

21-
createVirtualCode(uri, languageId, snapshot) {
21+
createVirtualCode(uri, languageId, snapshot): TsfsoVirtualCode | undefined {
2222
if (languageId === 'tsfso') {
2323
return new TsfsoVirtualCode(uri, snapshot, languageId);
2424
}
2525
},
2626
typescript: {
2727
extraFileExtensions: [{ extension: 'tsfso', isMixedContent: true, scriptKind: ts.ScriptKind.TS }],
28-
getServiceScript() {
28+
getServiceScript(): undefined {
2929
return undefined;
3030
},
31-
getExtraServiceScripts(fileName, root) {
31+
getExtraServiceScripts(fileName, root): TypeScriptExtraServiceScript[] {
3232
const scripts: TypeScriptExtraServiceScript[] = [];
3333
for (const code of forEachEmbeddedCode(root)) {
3434
if (code.languageId === 'javascript') {
@@ -50,7 +50,7 @@ export function getLanguagePlugin(): LanguagePlugin<URI, TsfsoVirtualCode> {
5050
}
5151
return scripts;
5252
},
53-
resolveLanguageServiceHost(host) {
53+
resolveLanguageServiceHost(host): ts.LanguageServiceHost {
5454
const baseCompilationSettings = host.getCompilationSettings();
5555
// Set compiler options
5656
const newSettings = {
@@ -63,7 +63,7 @@ export function getLanguagePlugin(): LanguagePlugin<URI, TsfsoVirtualCode> {
6363
return {
6464
...host,
6565
getCompilationSettings: () => newSettings,
66-
getScriptFileNames: () => {
66+
getScriptFileNames: (): string[] => {
6767
const fileNames = host.getScriptFileNames();
6868
const addedFileNames: string[] = [];
6969
addedFileNames.push(
@@ -95,12 +95,12 @@ class TsfsoVirtualCode implements VirtualCode {
9595
this.onSnapshotUpdated();
9696
}
9797

98-
public update(newSnapshot: ts.IScriptSnapshot) {
98+
public update(newSnapshot: ts.IScriptSnapshot): void {
9999
this.snapshot = newSnapshot;
100100
this.onSnapshotUpdated();
101101
}
102102

103-
private onSnapshotUpdated() {
103+
private onSnapshotUpdated(): void {
104104
this.mappings = [
105105
{
106106
sourceOffsets: [0],

packages/language-server/src/typescriptPlugin.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export const create = (ts: typeof import('typescript')): LanguageServicePlugin[]
1111
const typeScriptPlugin = plugin.create(context);
1212
return {
1313
...typeScriptPlugin,
14-
async provideDiagnostics(document, token) {
14+
async provideDiagnostics(document, token): Promise<import('@volar/language-server').Diagnostic[] | null> {
1515
const diagnostics = await typeScriptPlugin.provideDiagnostics?.(document, token);
1616
if (!diagnostics) return null;
1717

packages/superofficedx-vscode-core/src/commands/commandRegistration.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
import { DIContainer } from '../container';
2-
import { registerAuthCommands, registerScriptCommands } from './handlers';
1+
import { DIContainer } from '../container/core/diContainer';
2+
import { registerAuthCommands } from './handlers/authCommands';
3+
import { registerScriptCommands } from './handlers/scriptCommands';
34

45
/**
56
* Central command registration coordinator.

packages/superofficedx-vscode-core/src/commands/handlers/authCommands.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import { ExtensionContext, commands } from 'vscode';
2-
import { DIContainer, ConfigurationKeys } from '../../container';
2+
import { DIContainer } from '../../container/core/diContainer';
3+
import { ConfigurationKeys } from '../../container/configurations/configurationKeys';
34
import { CommandKeys } from '../commandKeys';
4-
import { startNativeAppFlow } from '../implementations/auth';
5+
import { startNativeAppFlow } from '../implementations/auth/startNativeAppFlow';
56

67
/**
78
* Factory for creating authentication-related command handlers

packages/superofficedx-vscode-core/src/commands/handlers/index.ts

Lines changed: 0 additions & 2 deletions
This file was deleted.

packages/superofficedx-vscode-core/src/commands/handlers/scriptCommands.ts

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
import { ExtensionContext, commands, Uri, window } from 'vscode';
2-
import { DIContainer, ConfigurationKeys } from '../../container';
2+
import { DIContainer } from '../../container/core/diContainer';
3+
import { ConfigurationKeys } from '../../container/configurations/configurationKeys';
34
import { CommandKeys } from '../commandKeys';
4-
import { Node, SuperofficeAuthenticationProvider } from '../../providers';
5-
import { IHttpService, INodeService } from '../../services';
6-
import { ScriptInfo } from '../../types';
5+
import { Node } from '../../providers/treeViewDataProvider';
6+
import { SuperofficeAuthenticationProvider } from '../../providers/superofficeAuthenticationProvider';
7+
import { IHttpService } from '../../services/httpService';
8+
import { INodeService } from '../../services/nodeService';
9+
import { ScriptInfo } from '../../types/script';
710

8-
// Import strict interfaces and types
911
import {
12+
IScriptCommands,
1013
ScriptPreviewParams,
1114
ScriptExecuteParams,
1215
ScriptExecuteLocallyParams,
@@ -15,13 +18,17 @@ import {
1518
ScriptUploadParams,
1619
ScriptViewDetailsParams,
1720
CommandResult,
18-
IScriptCommands,
1921
ScriptExecutionResult,
2022
ScriptDownloadResult
21-
} from '../types';
22-
23-
// Import implementations for commands
24-
import { download, downloadFolder, execute, executeLocally, upload, viewDetails, preview } from '../implementations/script';
23+
} from '../types/commandContracts';
24+
25+
import { preview } from '../implementations/script/preview';
26+
import { execute } from '../implementations/script/execute';
27+
import { executeLocally } from '../implementations/script/executeLocally';
28+
import { download } from '../implementations/script/download';
29+
import { downloadFolder } from '../implementations/script/downloadFolder';
30+
import { upload } from '../implementations/script/upload';
31+
import { viewDetails } from '../implementations/script/viewDetails';
2532

2633
/**
2734
* Strict script command factory with custom authentication provider

packages/superofficedx-vscode-core/src/commands/implementations/auth/index.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.

packages/superofficedx-vscode-core/src/commands/implementations/script/download.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
import { workspace, window, authentication } from 'vscode';
2+
23
import {
34
ScriptDownloadParams,
5+
ScriptDownloadResult,
46
CommandResult,
57
createSuccessResult,
68
createErrorResult,
7-
isValidScriptNode,
8-
ScriptDownloadResult
9-
} from '../../types';
10-
import { SuperOfficeAuthenticationSession } from '../../../types';
9+
isValidScriptNode
10+
} from '../../types/commandContracts';
11+
import { SuperOfficeAuthenticationSession } from '../../../types/authSession';
1112
import { getPackagePublisher } from '../../../utils';
1213

1314
export async function download(params: ScriptDownloadParams): Promise<CommandResult<ScriptDownloadResult>> {

0 commit comments

Comments
 (0)