Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cli/.vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"cwd": "${workspaceFolder:cli}",
"program": "${workspaceFolder:cli}/dist/index.js",
"sourceMaps": true,
"args": ["-d", "/Users/barry/Repos/ibmi-company_system", "--verbose", "--mcp", "5500"],
"args": ["-d", "/Users/barry/Repos/ibmi-company_system", "--verbose", "-bf", "make"],
"preLaunchTask": {
"type": "npm",
"script": "webpack:dev"
Expand Down
53 changes: 0 additions & 53 deletions cli/src/builders/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@ export function getBranchLibraryName(currentBranch: string) {
return `VS${(str(currentBranch, 0) >>> 0).toString(16).toUpperCase()}`;
}

export function extCanBeProgram(ext: string): boolean {
return ([`MODULE`, `PGM`].includes(getObjectType(ext)));
}

export function getTrueBasename(name: string) {
// Logic to handle second extension, caused by bob.
const sourceObjectTypes = [`.PGM`, `.SRVPGM`, `.TEST`];
Expand All @@ -60,55 +56,6 @@ export function getTrueBasename(name: string) {
return name;
}

export function getObjectType(ext: string): ObjectType {
switch (ext.toLowerCase()) {
case `dspf`:
case `prtf`:
case `pf`:
case `lf`:
case `sql`:
case `table`:
case `view`:
case `index`:
case `alias`:
case `sqludf`:
case `sqludt`:
case `sqlalias`:
case `sqlseq`:
case `sequence`:
case `msgf`:
return "FILE";

case `dtaara`:
return "DTAARA";

case `cmd`:
return "CMD";

case `rpgle`:
case `sqlrpgle`:
case `clle`:
case `cl`:
return "MODULE";

case `binder`:
case `bnd`:
case `function`:
return `SRVPGM`;

case `procedure`:
case `trigger`:
case `sqlprc`:
case `sqltrg`:
return `PGM`;

case `bnddir`:
return `BNDDIR`;
}

return undefined;
}

export function getDefaultCompiles(): CompileAttribute {
const binderSourceCompile: CompileData = {
becomes: `SRVPGM`,
Expand Down
11 changes: 0 additions & 11 deletions cli/src/extensions.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,2 @@

export const rpgExtensions = [`sqlrpgle`, `rpgle`];
export const clExtensions = [`clle`, `cl`, `clp`];
export const ddsExtension = [`pf`, `lf`, `dspf`, `prtf`];
export const sqlExtensions = [`sql`, `table`, `view`, `index`, `alias`, `sqlprc`, `sqludf`, `sqludt`, `sqltrg`, `sqlalias`, `sqlseq`];
export const srvPgmExtensions = [`binder`, `bnd`];
export const cmdExtensions = [`cmd`];
export const objectExtensions = [`dtaara`, `mnucmd`, `msgf`, `dtaq`, `bnddir`];

export const allExtensions = [...rpgExtensions, ...clExtensions, ...ddsExtension, ...sqlExtensions, ...srvPgmExtensions, ...cmdExtensions, ...objectExtensions];
export const scanGlob = `**/*.{${allExtensions.join(`,`)},${allExtensions.map(e => e.toUpperCase()).join(`,`)}}`;

export const referencesFileName = `.objrefs`;
11 changes: 7 additions & 4 deletions cli/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import path from 'path';
import { BuildFiles, cliSettings, error, infoOut, warningOut } from './cli';
import { BobProject } from "./builders/bob";
import { ImpactMarkdown } from "./builders/imd";
import { allExtensions, referencesFileName } from "./extensions";
import { referencesFileName } from "./extensions";
import { getBranchLibraryName } from "./builders/environment";
import { renameFiles, replaceIncludes } from './utils';
import { ReadFileSystem } from './readFileSystem';
Expand All @@ -23,7 +23,7 @@ if (isCli || process.env.VSCODE_INSPECTOR_OPTIONS) {
async function main() {
const parms = process.argv.slice(2);
let cwd = process.cwd();
let scanGlob = `**/*.{${allExtensions.join(`,`)},${allExtensions.map(e => e.toUpperCase()).join(`,`)}}`;
let scanGlob: string|undefined = undefined;

for (let i = 0; i < parms.length; i++) {
switch (parms[i]) {
Expand Down Expand Up @@ -162,6 +162,10 @@ async function main() {

let files: string[];

if (!scanGlob) {
scanGlob = targets.getSearchGlob();
}

try {
files = await fs.getFiles(cwd, scanGlob);
} catch (e) {
Expand Down Expand Up @@ -295,6 +299,5 @@ async function listDeps(cwd: string, targets: Targets, query: string) {
export { Targets } from './targets';
export { MakeProject } from './builders/make';
export { BobProject } from "./builders/bob";
export { ImpactMarkdown } from "./builders/imd"
export { allExtensions } from "./extensions";
export { ImpactMarkdown } from "./builders/imd"
export * as Utils from './utils';
78 changes: 0 additions & 78 deletions cli/src/languages/rpgle.ts

This file was deleted.

3 changes: 1 addition & 2 deletions cli/src/readFileSystem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@ import glob from "glob";
import path from 'path';
import os from 'os';
import { getFiles } from './utils';
import { scanGlob } from './extensions';

export class ReadFileSystem {
constructor() {}

async getFiles(cwd: string, globPath = scanGlob, additionalOpts: any = {}): Promise<string[]> {
async getFiles(cwd: string, globPath, additionalOpts: any = {}): Promise<string[]> {
return getFiles(cwd, globPath, additionalOpts);
}

Expand Down
Loading