From 410880ed284c3259b9ec5b65ec05bfc3eaf99d30 Mon Sep 17 00:00:00 2001 From: dulaj Date: Wed, 18 Feb 2026 07:28:00 +0530 Subject: [PATCH] Fix workspace intermittent test by removing imported modules --- .../functions/workspace_pkg1_default.json | 425 +++--------------- .../config/types/workspace_pkg1_default.json | 332 +------------- .../config/types/workspace_pkg2_default.json | 332 +------------- .../source/workspace1/package1/main.bal | 6 +- .../source/workspace1/package1/timeutils.bal | 8 +- .../source/workspace1/package2/main.bal | 6 +- 6 files changed, 61 insertions(+), 1048 deletions(-) diff --git a/flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/search/config/functions/workspace_pkg1_default.json b/flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/search/config/functions/workspace_pkg1_default.json index 73616bc3f2..e213122438 100644 --- a/flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/search/config/functions/workspace_pkg1_default.json +++ b/flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/search/config/functions/workspace_pkg1_default.json @@ -334,6 +334,17 @@ "Library" ] }, + "items": [] + }, + { + "metadata": { + "label": "Standard Library", + "description": "Components supported officially by Ballerina", + "keywords": [ + "Ballerina", + "Library" + ] + }, "items": [ { "metadata": { @@ -342,326 +353,6 @@ "keywords": [] }, "items": [ - { - "metadata": { - "label": "fileReadBytes", - "description": "Read the entire file content as a byte array.\n```ballerina\nbyte[]|io:Error content = io:fileReadBytes(\"./resources/myfile.txt\");\n```", - "icon": "https://bcentral-packageicons.azureedge.net/images/ballerina_io_1.8.0.png" - }, - "codedata": { - "node": "FUNCTION_CALL", - "org": "ballerina", - "module": "io", - "packageName": "io", - "symbol": "fileReadBytes", - "version": "1.8.0" - }, - "enabled": true - }, - { - "metadata": { - "label": "fileReadBlocksAsStream", - "description": "Read the entire file content as a stream of blocks.\n```ballerina\nstream|io:Error content = io:fileReadBlocksAsStream(\"./resources/myfile.txt\", 1000);\n```", - "icon": "https://bcentral-packageicons.azureedge.net/images/ballerina_io_1.8.0.png" - }, - "codedata": { - "node": "FUNCTION_CALL", - "org": "ballerina", - "module": "io", - "packageName": "io", - "symbol": "fileReadBlocksAsStream", - "version": "1.8.0" - }, - "enabled": true - }, - { - "metadata": { - "label": "fileWriteBytes", - "description": "Write a set of bytes to a file.\n```ballerina\nbyte[] content = [60, 78, 39, 28];\nio:Error? result = io:fileWriteBytes(\"./resources/myfile.txt\", content);\n```", - "icon": "https://bcentral-packageicons.azureedge.net/images/ballerina_io_1.8.0.png" - }, - "codedata": { - "node": "FUNCTION_CALL", - "org": "ballerina", - "module": "io", - "packageName": "io", - "symbol": "fileWriteBytes", - "version": "1.8.0" - }, - "enabled": true - }, - { - "metadata": { - "label": "fileWriteBlocksFromStream", - "description": "Write a byte stream to a file.\n```ballerina\nbyte[] content = [[60, 78, 39, 28]];\nstream byteStream = content.toStream();\nio:Error? result = io:fileWriteBlocksFromStream(\"./resources/myfile.txt\", byteStream);\n```", - "icon": "https://bcentral-packageicons.azureedge.net/images/ballerina_io_1.8.0.png" - }, - "codedata": { - "node": "FUNCTION_CALL", - "org": "ballerina", - "module": "io", - "packageName": "io", - "symbol": "fileWriteBlocksFromStream", - "version": "1.8.0" - }, - "enabled": true - }, - { - "metadata": { - "label": "fileReadCsv", - "description": "Read file content as a CSV.\nWhen the expected data type is record[], the first entry of the csv file should contain matching headers.\n```ballerina\nstring[][]|io:Error content = io:fileReadCsv(\"./resources/myfile.csv\");\nrecord{}[]|io:Error content = io:fileReadCsv(\"./resources/myfile.csv\");\n```", - "icon": "https://bcentral-packageicons.azureedge.net/images/ballerina_io_1.8.0.png" - }, - "codedata": { - "node": "FUNCTION_CALL", - "org": "ballerina", - "module": "io", - "packageName": "io", - "symbol": "fileReadCsv", - "version": "1.8.0" - }, - "enabled": true - }, - { - "metadata": { - "label": "fileReadCsvAsStream", - "description": "Read file content as a CSV.\nWhen the expected data type is stream,\nthe first entry of the csv file should contain matching headers.\n```ballerina\nstream|io:Error content = io:fileReadCsvAsStream(\"./resources/myfile.csv\");\n```", - "icon": "https://bcentral-packageicons.azureedge.net/images/ballerina_io_1.8.0.png" - }, - "codedata": { - "node": "FUNCTION_CALL", - "org": "ballerina", - "module": "io", - "packageName": "io", - "symbol": "fileReadCsvAsStream", - "version": "1.8.0" - }, - "enabled": true - }, - { - "metadata": { - "label": "fileWriteCsv", - "description": "Write CSV content to a file.\nWhen the input is a record[] type in `OVERWRITE`, headers will be written to the CSV file by default.\nFor `APPEND`, order of the existing csv file is inferred using the headers and used as the order.\n```ballerina\ntype Coord record {int x;int y;};\nCoord[] contentRecord = [{x: 1,y: 2},{x: 1,y: 2}]\nstring[][] content = [[\"Anne\", \"Johnson\", \"SE\"], [\"John\", \"Cameron\", \"QA\"]];\nio:Error? result = io:fileWriteCsv(\"./resources/myfile.csv\", content);\nio:Error? resultRecord = io:fileWriteCsv(\"./resources/myfileRecord.csv\", contentRecord);\n```", - "icon": "https://bcentral-packageicons.azureedge.net/images/ballerina_io_1.8.0.png" - }, - "codedata": { - "node": "FUNCTION_CALL", - "org": "ballerina", - "module": "io", - "packageName": "io", - "symbol": "fileWriteCsv", - "version": "1.8.0" - }, - "enabled": true - }, - { - "metadata": { - "label": "fileWriteCsvFromStream", - "description": "Write CSV record stream to a file.\nWhen the input is a `stream` in `OVERWRITE`, headers will be written to the CSV file by default.\nFor `APPEND`, order of the existing csv file is inferred using the headers and used as the order.\n```ballerina\ntype Coord record {int x;int y;};\nCoord[] contentRecord = [{x: 1,y: 2},{x: 1,y: 2}]\nstring[][] content = [[\"Anne\", \"Johnson\", \"SE\"], [\"John\", \"Cameron\", \"QA\"]];\nstream stringStream = content.toStream();\nstream recordStream = contentRecord.toStream();\nio:Error? result = io:fileWriteCsvFromStream(\"./resources/myfile.csv\", stringStream);\nio:Error? resultRecord = io:fileWriteCsvFromStream(\"./resources/myfileRecord.csv\", recordStream);\n```", - "icon": "https://bcentral-packageicons.azureedge.net/images/ballerina_io_1.8.0.png" - }, - "codedata": { - "node": "FUNCTION_CALL", - "org": "ballerina", - "module": "io", - "packageName": "io", - "symbol": "fileWriteCsvFromStream", - "version": "1.8.0" - }, - "enabled": true - }, - { - "metadata": { - "label": "fileReadString", - "description": "Reads the entire file content as a `string`.\nThe resulting string output does not contain the terminal carriage (e.g., `\\r` or `\\n`).\n```ballerina\nstring|io:Error content = io:fileReadString(\"./resources/myfile.txt\");\n```", - "icon": "https://bcentral-packageicons.azureedge.net/images/ballerina_io_1.8.0.png" - }, - "codedata": { - "node": "FUNCTION_CALL", - "org": "ballerina", - "module": "io", - "packageName": "io", - "symbol": "fileReadString", - "version": "1.8.0" - }, - "enabled": true - }, - { - "metadata": { - "label": "fileReadLines", - "description": "Reads the entire file content as a list of lines.\nThe resulting string array does not contain the terminal carriage (e.g., `\\r` or `\\n`).\n```ballerina\nstring[]|io:Error content = io:fileReadLines(\"./resources/myfile.txt\");\n```", - "icon": "https://bcentral-packageicons.azureedge.net/images/ballerina_io_1.8.0.png" - }, - "codedata": { - "node": "FUNCTION_CALL", - "org": "ballerina", - "module": "io", - "packageName": "io", - "symbol": "fileReadLines", - "version": "1.8.0" - }, - "enabled": true - }, - { - "metadata": { - "label": "fileReadLinesAsStream", - "description": "Reads file content as a stream of lines.\nThe resulting stream does not contain the terminal carriage (e.g., `\\r` or `\\n`).\n```ballerina\nstream|io:Error content = io:fileReadLinesAsStream(\"./resources/myfile.txt\");\n```", - "icon": "https://bcentral-packageicons.azureedge.net/images/ballerina_io_1.8.0.png" - }, - "codedata": { - "node": "FUNCTION_CALL", - "org": "ballerina", - "module": "io", - "packageName": "io", - "symbol": "fileReadLinesAsStream", - "version": "1.8.0" - }, - "enabled": true - }, - { - "metadata": { - "label": "fileReadJson", - "description": "Reads file content as a JSON.\n```ballerina\njson|io:Error content = io:fileReadJson(\"./resources/myfile.json\");\n```", - "icon": "https://bcentral-packageicons.azureedge.net/images/ballerina_io_1.8.0.png" - }, - "codedata": { - "node": "FUNCTION_CALL", - "org": "ballerina", - "module": "io", - "packageName": "io", - "symbol": "fileReadJson", - "version": "1.8.0" - }, - "enabled": true - }, - { - "metadata": { - "label": "fileReadXml", - "description": "Reads file content as an XML.\n```ballerina\nxml|io:Error content = io:fileReadXml(\"./resources/myfile.xml\");\n```", - "icon": "https://bcentral-packageicons.azureedge.net/images/ballerina_io_1.8.0.png" - }, - "codedata": { - "node": "FUNCTION_CALL", - "org": "ballerina", - "module": "io", - "packageName": "io", - "symbol": "fileReadXml", - "version": "1.8.0" - }, - "enabled": true - }, - { - "metadata": { - "label": "fileWriteString", - "description": "Write a string content to a file.\n```ballerina\nstring content = \"Hello Universe..!!\";\nio:Error? result = io:fileWriteString(\"./resources/myfile.txt\", content);\n```", - "icon": "https://bcentral-packageicons.azureedge.net/images/ballerina_io_1.8.0.png" - }, - "codedata": { - "node": "FUNCTION_CALL", - "org": "ballerina", - "module": "io", - "packageName": "io", - "symbol": "fileWriteString", - "version": "1.8.0" - }, - "enabled": true - }, - { - "metadata": { - "label": "fileWriteLines", - "description": "Write an array of lines to a file.\nDuring the writing operation, a newline character `\\n` will be added after each line.\n```ballerina\nstring[] content = [\"Hello Universe..!!\", \"How are you?\"];\nio:Error? result = io:fileWriteLines(\"./resources/myfile.txt\", content);\n```", - "icon": "https://bcentral-packageicons.azureedge.net/images/ballerina_io_1.8.0.png" - }, - "codedata": { - "node": "FUNCTION_CALL", - "org": "ballerina", - "module": "io", - "packageName": "io", - "symbol": "fileWriteLines", - "version": "1.8.0" - }, - "enabled": true - }, - { - "metadata": { - "label": "fileWriteLinesFromStream", - "description": "Write stream of lines to a file.\nDuring the writing operation, a newline character `\\n` will be added after each line.\n```ballerina\nstring content = [\"Hello Universe..!!\", \"How are you?\"];\nstream lineStream = content.toStream();\nio:Error? result = io:fileWriteLinesFromStream(\"./resources/myfile.txt\", lineStream);\n```", - "icon": "https://bcentral-packageicons.azureedge.net/images/ballerina_io_1.8.0.png" - }, - "codedata": { - "node": "FUNCTION_CALL", - "org": "ballerina", - "module": "io", - "packageName": "io", - "symbol": "fileWriteLinesFromStream", - "version": "1.8.0" - }, - "enabled": true - }, - { - "metadata": { - "label": "fileWriteJson", - "description": "Write a JSON to a file.\n```ballerina\njson content = {\"name\": \"Anne\", \"age\": 30};\nio:Error? result = io:fileWriteJson(\"./resources/myfile.json\", content);\n```", - "icon": "https://bcentral-packageicons.azureedge.net/images/ballerina_io_1.8.0.png" - }, - "codedata": { - "node": "FUNCTION_CALL", - "org": "ballerina", - "module": "io", - "packageName": "io", - "symbol": "fileWriteJson", - "version": "1.8.0" - }, - "enabled": true - }, - { - "metadata": { - "label": "fileWriteXml", - "description": "Write XML content to a file.\n```ballerina\nxml content = xml `The Lost World`;\nio:Error? result = io:fileWriteXml(\"./resources/myfile.xml\", content);\n```", - "icon": "https://bcentral-packageicons.azureedge.net/images/ballerina_io_1.8.0.png" - }, - "codedata": { - "node": "FUNCTION_CALL", - "org": "ballerina", - "module": "io", - "packageName": "io", - "symbol": "fileWriteXml", - "version": "1.8.0" - }, - "enabled": true - }, - { - "metadata": { - "label": "openReadableFile", - "description": "Retrieves a `ReadableByteChannel` from a given file path.\n```ballerina\nio:ReadableByteChannel readableFieldResult = check io:openReadableFile(\"./files/sample.txt\");\n```\n", - "icon": "https://bcentral-packageicons.azureedge.net/images/ballerina_io_1.8.0.png" - }, - "codedata": { - "node": "FUNCTION_CALL", - "org": "ballerina", - "module": "io", - "packageName": "io", - "symbol": "openReadableFile", - "version": "1.8.0" - }, - "enabled": true - }, - { - "metadata": { - "label": "openWritableFile", - "description": "Retrieves a `WritableByteChannel` from a given file path.\n```ballerina\nio:WritableByteChannel writableFileResult = check io:openWritableFile(\"./files/sampleResponse.txt\");\n```\n", - "icon": "https://bcentral-packageicons.azureedge.net/images/ballerina_io_1.8.0.png" - }, - "codedata": { - "node": "FUNCTION_CALL", - "org": "ballerina", - "module": "io", - "packageName": "io", - "symbol": "openWritableFile", - "version": "1.8.0" - }, - "enabled": true - }, { "metadata": { "label": "fileReadJson", @@ -760,59 +451,6 @@ } ] }, - { - "metadata": { - "label": "time", - "description": "", - "keywords": [] - }, - "items": [ - { - "metadata": { - "label": "utcFromString", - "description": "Converts from RFC 3339 timestamp (e.g., `2007-12-03T10:15:30.00Z`) to Utc.\n```ballerina\ntime:Utc|time:Error utc = time:utcFromString(\"2007-12-03T10:15:30.00Z\");\n```", - "icon": "https://bcentral-packageicons.azureedge.net/images/ballerina_time_2.7.0.png" - }, - "codedata": { - "node": "FUNCTION_CALL", - "org": "ballerina", - "module": "time", - "packageName": "time", - "symbol": "utcFromString", - "version": "2.7.0" - }, - "enabled": true - }, - { - "metadata": { - "label": "utcNow", - "description": "Returns the UTC representing the current time (current instant of the system clock in seconds from the epoch of `1970-01-01T00:00:00`).\n```ballerina\ntime:Utc utc = time:utcNow();\n```", - "icon": "https://bcentral-packageicons.azureedge.net/images/ballerina_time_2.7.0.png" - }, - "codedata": { - "node": "FUNCTION_CALL", - "org": "ballerina", - "module": "time", - "packageName": "time", - "symbol": "utcNow", - "version": "2.7.0" - }, - "enabled": true - } - ] - } - ] - }, - { - "metadata": { - "label": "Standard Library", - "description": "Components supported officially by Ballerina", - "keywords": [ - "Ballerina", - "Library" - ] - }, - "items": [ { "metadata": { "label": "log", @@ -885,6 +523,47 @@ "enabled": true } ] + }, + { + "metadata": { + "label": "time", + "description": "", + "keywords": [] + }, + "items": [ + { + "metadata": { + "label": "utcFromString", + "description": "Converts from RFC 3339 timestamp (e.g., `2007-12-03T10:15:30.00Z`) to Utc.\n```ballerina\ntime:Utc|time:Error utc = time:utcFromString(\"2007-12-03T10:15:30.00Z\");\n```", + "icon": "https://bcentral-packageicons.azureedge.net/images/ballerina_time_2.7.0.png" + }, + "codedata": { + "node": "FUNCTION_CALL", + "org": "ballerina", + "module": "time", + "packageName": "time", + "symbol": "utcFromString", + "version": "2.7.0" + }, + "enabled": true + }, + { + "metadata": { + "label": "utcNow", + "description": "Returns the UTC representing the current time (current instant of the system clock in seconds from the epoch of `1970-01-01T00:00:00`).\n```ballerina\ntime:Utc utc = time:utcNow();\n```", + "icon": "https://bcentral-packageicons.azureedge.net/images/ballerina_time_2.7.0.png" + }, + "codedata": { + "node": "FUNCTION_CALL", + "org": "ballerina", + "module": "time", + "packageName": "time", + "symbol": "utcNow", + "version": "2.7.0" + }, + "enabled": true + } + ] } ] } diff --git a/flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/search/config/types/workspace_pkg1_default.json b/flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/search/config/types/workspace_pkg1_default.json index d7bafcabba..48678a6d71 100644 --- a/flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/search/config/types/workspace_pkg1_default.json +++ b/flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/search/config/types/workspace_pkg1_default.json @@ -94,337 +94,7 @@ "Library" ] }, - "items": [ - { - "metadata": { - "label": "io", - "description": "", - "keywords": [] - }, - "items": [ - { - "metadata": { - "label": "Block", - "description": "The read-only byte array that is used to read the byte content from the streams.", - "icon": "https://bcentral-packageicons.azureedge.net/images/ballerina_io_1.8.0.png" - }, - "codedata": { - "node": "TYPEDESC", - "org": "ballerina", - "module": "io", - "packageName": "io", - "symbol": "Block", - "version": "1.8.0" - }, - "enabled": true - }, - { - "metadata": { - "label": "ReadableByteChannel", - "description": "ReadableByteChannel represents an input resource (i.e file), which could be used to source bytes.\nA file path or an in-memory `byte` array can be used to obtain an `io:ReadableByteChannel`.\nAn `io:ReadableByteChannel` does not support initialization, and it should be obtained using the following methods or implemented natively.\n\n`io:openReadableFile(\"./files/sample.txt\")` - used to obtain an `io:ReadableByteChannel` from a given file path\n`io:createReadableChannel(byteArray)` - used to obtain an `io:ReadableByteChannel` from a given `byte` array", - "icon": "https://bcentral-packageicons.azureedge.net/images/ballerina_io_1.8.0.png" - }, - "codedata": { - "node": "TYPEDESC", - "org": "ballerina", - "module": "io", - "packageName": "io", - "symbol": "ReadableByteChannel", - "version": "1.8.0" - }, - "enabled": true - }, - { - "metadata": { - "label": "ReadableCharacterChannel", - "description": "Represents a channel, which could be used to read characters through a given ReadableByteChannel.", - "icon": "https://bcentral-packageicons.azureedge.net/images/ballerina_io_1.8.0.png" - }, - "codedata": { - "node": "TYPEDESC", - "org": "ballerina", - "module": "io", - "packageName": "io", - "symbol": "ReadableCharacterChannel", - "version": "1.8.0" - }, - "enabled": true - }, - { - "metadata": { - "label": "ReadableTextRecordChannel", - "description": "Represents a channel which will allow to read.", - "icon": "https://bcentral-packageicons.azureedge.net/images/ballerina_io_1.8.0.png" - }, - "codedata": { - "node": "TYPEDESC", - "org": "ballerina", - "module": "io", - "packageName": "io", - "symbol": "ReadableTextRecordChannel", - "version": "1.8.0" - }, - "enabled": true - }, - { - "metadata": { - "label": "ReadableCSVChannel", - "description": "Represents a ReadableCSVChannel which could be used to read records from CSV file.", - "icon": "https://bcentral-packageicons.azureedge.net/images/ballerina_io_1.8.0.png" - }, - "codedata": { - "node": "TYPEDESC", - "org": "ballerina", - "module": "io", - "packageName": "io", - "symbol": "ReadableCSVChannel", - "version": "1.8.0" - }, - "enabled": true - }, - { - "metadata": { - "label": "WritableByteChannel", - "description": "WritableByteChannel represents an output resource (i.e file) which could be used to sink bytes\nA file path can be used to obtain an `io:WritableByteChannel`.\nAn `io:WritableByteChannel` can only be obtained using the following method or by providing a native implementation.\nIt cannot be instantiated.\n`io:openWritableFile(\"./files/sample.txt\")` - used to obtain an `io:WritableByteChannel` from a given file path", - "icon": "https://bcentral-packageicons.azureedge.net/images/ballerina_io_1.8.0.png" - }, - "codedata": { - "node": "TYPEDESC", - "org": "ballerina", - "module": "io", - "packageName": "io", - "symbol": "WritableByteChannel", - "version": "1.8.0" - }, - "enabled": true - }, - { - "metadata": { - "label": "WritableCharacterChannel", - "description": "Represents a channel which could be used to write characters through a given WritableCharacterChannel.", - "icon": "https://bcentral-packageicons.azureedge.net/images/ballerina_io_1.8.0.png" - }, - "codedata": { - "node": "TYPEDESC", - "org": "ballerina", - "module": "io", - "packageName": "io", - "symbol": "WritableCharacterChannel", - "version": "1.8.0" - }, - "enabled": true - }, - { - "metadata": { - "label": "WritableTextRecordChannel", - "description": "Represents a channel, which will allow to write records through a given WritableCharacterChannel.", - "icon": "https://bcentral-packageicons.azureedge.net/images/ballerina_io_1.8.0.png" - }, - "codedata": { - "node": "TYPEDESC", - "org": "ballerina", - "module": "io", - "packageName": "io", - "symbol": "WritableTextRecordChannel", - "version": "1.8.0" - }, - "enabled": true - }, - { - "metadata": { - "label": "WritableCSVChannel", - "description": "Represents a WritableCSVChannel, which could be used to write records from the CSV file.", - "icon": "https://bcentral-packageicons.azureedge.net/images/ballerina_io_1.8.0.png" - }, - "codedata": { - "node": "TYPEDESC", - "org": "ballerina", - "module": "io", - "packageName": "io", - "symbol": "WritableCSVChannel", - "version": "1.8.0" - }, - "enabled": true - }, - { - "metadata": { - "label": "Format", - "description": "The format, which will be used to represent the CSV.\n\nDEFAULT - The default value is the format specified by the CSVChannel. Precedence will be given to the field\nseparator and record separator.\n\nCSV - Field separator will be \",\" and the record separator will be a new line.\n\nTDF - Field separator will be a tab and the record separator will be a new line.", - "icon": "https://bcentral-packageicons.azureedge.net/images/ballerina_io_1.8.0.png" - }, - "codedata": { - "node": "TYPEDESC", - "org": "ballerina", - "module": "io", - "packageName": "io", - "symbol": "Format", - "version": "1.8.0" - }, - "enabled": true - }, - { - "metadata": { - "label": "Separator", - "description": "Field separators, which are supported by the `DelimitedTextRecordChannel`.\n\nCOMMA - Delimited text records will be separated using a comma\n\nTAB - Delimited text records will be separated using a tab\n\nCOLON - Delimited text records will be separated using a colon(:)", - "icon": "https://bcentral-packageicons.azureedge.net/images/ballerina_io_1.8.0.png" - }, - "codedata": { - "node": "TYPEDESC", - "org": "ballerina", - "module": "io", - "packageName": "io", - "symbol": "Separator", - "version": "1.8.0" - }, - "enabled": true - }, - { - "metadata": { - "label": "Error", - "description": "Represents IO module related errors.", - "icon": "https://bcentral-packageicons.azureedge.net/images/ballerina_io_1.8.0.png" - }, - "codedata": { - "node": "TYPEDESC", - "org": "ballerina", - "module": "io", - "packageName": "io", - "symbol": "Error", - "version": "1.8.0" - }, - "enabled": true - }, - { - "metadata": { - "label": "ConnectionTimedOutError", - "description": "This will return when connection timed out happen when try to connect to a remote host.", - "icon": "https://bcentral-packageicons.azureedge.net/images/ballerina_io_1.8.0.png" - }, - "codedata": { - "node": "TYPEDESC", - "org": "ballerina", - "module": "io", - "packageName": "io", - "symbol": "ConnectionTimedOutError", - "version": "1.8.0" - }, - "enabled": true - }, - { - "metadata": { - "label": "GenericError", - "description": "Represents generic IO error. The detail record contains the information related to the error.", - "icon": "https://bcentral-packageicons.azureedge.net/images/ballerina_io_1.8.0.png" - }, - "codedata": { - "node": "TYPEDESC", - "org": "ballerina", - "module": "io", - "packageName": "io", - "symbol": "GenericError", - "version": "1.8.0" - }, - "enabled": true - }, - { - "metadata": { - "label": "AccessDeniedError", - "description": "This will get returned due to file permission issues.", - "icon": "https://bcentral-packageicons.azureedge.net/images/ballerina_io_1.8.0.png" - }, - "codedata": { - "node": "TYPEDESC", - "org": "ballerina", - "module": "io", - "packageName": "io", - "symbol": "AccessDeniedError", - "version": "1.8.0" - }, - "enabled": true - }, - { - "metadata": { - "label": "FileNotFoundError", - "description": "This will get returned if the file is not available in the given file path.", - "icon": "https://bcentral-packageicons.azureedge.net/images/ballerina_io_1.8.0.png" - }, - "codedata": { - "node": "TYPEDESC", - "org": "ballerina", - "module": "io", - "packageName": "io", - "symbol": "FileNotFoundError", - "version": "1.8.0" - }, - "enabled": true - }, - { - "metadata": { - "label": "TypeMismatchError", - "description": "This will get returned when there is an mismatch of given type and the expected type.", - "icon": "https://bcentral-packageicons.azureedge.net/images/ballerina_io_1.8.0.png" - }, - "codedata": { - "node": "TYPEDESC", - "org": "ballerina", - "module": "io", - "packageName": "io", - "symbol": "TypeMismatchError", - "version": "1.8.0" - }, - "enabled": true - }, - { - "metadata": { - "label": "EofError", - "description": "This will get returned if read operations are performed on a channel after it closed.", - "icon": "https://bcentral-packageicons.azureedge.net/images/ballerina_io_1.8.0.png" - }, - "codedata": { - "node": "TYPEDESC", - "org": "ballerina", - "module": "io", - "packageName": "io", - "symbol": "EofError", - "version": "1.8.0" - }, - "enabled": true - }, - { - "metadata": { - "label": "ConfigurationError", - "description": "This will get returned if there is an invalid configuration.", - "icon": "https://bcentral-packageicons.azureedge.net/images/ballerina_io_1.8.0.png" - }, - "codedata": { - "node": "TYPEDESC", - "org": "ballerina", - "module": "io", - "packageName": "io", - "symbol": "ConfigurationError", - "version": "1.8.0" - }, - "enabled": true - }, - { - "metadata": { - "label": "FileWriteOption", - "description": "Represents a file opening options for writing.\n", - "icon": "https://bcentral-packageicons.azureedge.net/images/ballerina_io_1.8.0.png" - }, - "codedata": { - "node": "TYPEDESC", - "org": "ballerina", - "module": "io", - "packageName": "io", - "symbol": "FileWriteOption", - "version": "1.8.0" - }, - "enabled": true - } - ] - } - ] + "items": [] }, { "metadata": { diff --git a/flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/search/config/types/workspace_pkg2_default.json b/flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/search/config/types/workspace_pkg2_default.json index 1e10e21b31..e8fd3d13ad 100644 --- a/flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/search/config/types/workspace_pkg2_default.json +++ b/flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/search/config/types/workspace_pkg2_default.json @@ -79,337 +79,7 @@ "Library" ] }, - "items": [ - { - "metadata": { - "label": "io", - "description": "", - "keywords": [] - }, - "items": [ - { - "metadata": { - "label": "Block", - "description": "The read-only byte array that is used to read the byte content from the streams.", - "icon": "https://bcentral-packageicons.azureedge.net/images/ballerina_io_1.8.0.png" - }, - "codedata": { - "node": "TYPEDESC", - "org": "ballerina", - "module": "io", - "packageName": "io", - "symbol": "Block", - "version": "1.8.0" - }, - "enabled": true - }, - { - "metadata": { - "label": "ReadableByteChannel", - "description": "ReadableByteChannel represents an input resource (i.e file), which could be used to source bytes.\nA file path or an in-memory `byte` array can be used to obtain an `io:ReadableByteChannel`.\nAn `io:ReadableByteChannel` does not support initialization, and it should be obtained using the following methods or implemented natively.\n\n`io:openReadableFile(\"./files/sample.txt\")` - used to obtain an `io:ReadableByteChannel` from a given file path\n`io:createReadableChannel(byteArray)` - used to obtain an `io:ReadableByteChannel` from a given `byte` array", - "icon": "https://bcentral-packageicons.azureedge.net/images/ballerina_io_1.8.0.png" - }, - "codedata": { - "node": "TYPEDESC", - "org": "ballerina", - "module": "io", - "packageName": "io", - "symbol": "ReadableByteChannel", - "version": "1.8.0" - }, - "enabled": true - }, - { - "metadata": { - "label": "ReadableCharacterChannel", - "description": "Represents a channel, which could be used to read characters through a given ReadableByteChannel.", - "icon": "https://bcentral-packageicons.azureedge.net/images/ballerina_io_1.8.0.png" - }, - "codedata": { - "node": "TYPEDESC", - "org": "ballerina", - "module": "io", - "packageName": "io", - "symbol": "ReadableCharacterChannel", - "version": "1.8.0" - }, - "enabled": true - }, - { - "metadata": { - "label": "ReadableTextRecordChannel", - "description": "Represents a channel which will allow to read.", - "icon": "https://bcentral-packageicons.azureedge.net/images/ballerina_io_1.8.0.png" - }, - "codedata": { - "node": "TYPEDESC", - "org": "ballerina", - "module": "io", - "packageName": "io", - "symbol": "ReadableTextRecordChannel", - "version": "1.8.0" - }, - "enabled": true - }, - { - "metadata": { - "label": "ReadableCSVChannel", - "description": "Represents a ReadableCSVChannel which could be used to read records from CSV file.", - "icon": "https://bcentral-packageicons.azureedge.net/images/ballerina_io_1.8.0.png" - }, - "codedata": { - "node": "TYPEDESC", - "org": "ballerina", - "module": "io", - "packageName": "io", - "symbol": "ReadableCSVChannel", - "version": "1.8.0" - }, - "enabled": true - }, - { - "metadata": { - "label": "WritableByteChannel", - "description": "WritableByteChannel represents an output resource (i.e file) which could be used to sink bytes\nA file path can be used to obtain an `io:WritableByteChannel`.\nAn `io:WritableByteChannel` can only be obtained using the following method or by providing a native implementation.\nIt cannot be instantiated.\n`io:openWritableFile(\"./files/sample.txt\")` - used to obtain an `io:WritableByteChannel` from a given file path", - "icon": "https://bcentral-packageicons.azureedge.net/images/ballerina_io_1.8.0.png" - }, - "codedata": { - "node": "TYPEDESC", - "org": "ballerina", - "module": "io", - "packageName": "io", - "symbol": "WritableByteChannel", - "version": "1.8.0" - }, - "enabled": true - }, - { - "metadata": { - "label": "WritableCharacterChannel", - "description": "Represents a channel which could be used to write characters through a given WritableCharacterChannel.", - "icon": "https://bcentral-packageicons.azureedge.net/images/ballerina_io_1.8.0.png" - }, - "codedata": { - "node": "TYPEDESC", - "org": "ballerina", - "module": "io", - "packageName": "io", - "symbol": "WritableCharacterChannel", - "version": "1.8.0" - }, - "enabled": true - }, - { - "metadata": { - "label": "WritableTextRecordChannel", - "description": "Represents a channel, which will allow to write records through a given WritableCharacterChannel.", - "icon": "https://bcentral-packageicons.azureedge.net/images/ballerina_io_1.8.0.png" - }, - "codedata": { - "node": "TYPEDESC", - "org": "ballerina", - "module": "io", - "packageName": "io", - "symbol": "WritableTextRecordChannel", - "version": "1.8.0" - }, - "enabled": true - }, - { - "metadata": { - "label": "WritableCSVChannel", - "description": "Represents a WritableCSVChannel, which could be used to write records from the CSV file.", - "icon": "https://bcentral-packageicons.azureedge.net/images/ballerina_io_1.8.0.png" - }, - "codedata": { - "node": "TYPEDESC", - "org": "ballerina", - "module": "io", - "packageName": "io", - "symbol": "WritableCSVChannel", - "version": "1.8.0" - }, - "enabled": true - }, - { - "metadata": { - "label": "Format", - "description": "The format, which will be used to represent the CSV.\n\nDEFAULT - The default value is the format specified by the CSVChannel. Precedence will be given to the field\nseparator and record separator.\n\nCSV - Field separator will be \",\" and the record separator will be a new line.\n\nTDF - Field separator will be a tab and the record separator will be a new line.", - "icon": "https://bcentral-packageicons.azureedge.net/images/ballerina_io_1.8.0.png" - }, - "codedata": { - "node": "TYPEDESC", - "org": "ballerina", - "module": "io", - "packageName": "io", - "symbol": "Format", - "version": "1.8.0" - }, - "enabled": true - }, - { - "metadata": { - "label": "Separator", - "description": "Field separators, which are supported by the `DelimitedTextRecordChannel`.\n\nCOMMA - Delimited text records will be separated using a comma\n\nTAB - Delimited text records will be separated using a tab\n\nCOLON - Delimited text records will be separated using a colon(:)", - "icon": "https://bcentral-packageicons.azureedge.net/images/ballerina_io_1.8.0.png" - }, - "codedata": { - "node": "TYPEDESC", - "org": "ballerina", - "module": "io", - "packageName": "io", - "symbol": "Separator", - "version": "1.8.0" - }, - "enabled": true - }, - { - "metadata": { - "label": "Error", - "description": "Represents IO module related errors.", - "icon": "https://bcentral-packageicons.azureedge.net/images/ballerina_io_1.8.0.png" - }, - "codedata": { - "node": "TYPEDESC", - "org": "ballerina", - "module": "io", - "packageName": "io", - "symbol": "Error", - "version": "1.8.0" - }, - "enabled": true - }, - { - "metadata": { - "label": "ConnectionTimedOutError", - "description": "This will return when connection timed out happen when try to connect to a remote host.", - "icon": "https://bcentral-packageicons.azureedge.net/images/ballerina_io_1.8.0.png" - }, - "codedata": { - "node": "TYPEDESC", - "org": "ballerina", - "module": "io", - "packageName": "io", - "symbol": "ConnectionTimedOutError", - "version": "1.8.0" - }, - "enabled": true - }, - { - "metadata": { - "label": "GenericError", - "description": "Represents generic IO error. The detail record contains the information related to the error.", - "icon": "https://bcentral-packageicons.azureedge.net/images/ballerina_io_1.8.0.png" - }, - "codedata": { - "node": "TYPEDESC", - "org": "ballerina", - "module": "io", - "packageName": "io", - "symbol": "GenericError", - "version": "1.8.0" - }, - "enabled": true - }, - { - "metadata": { - "label": "AccessDeniedError", - "description": "This will get returned due to file permission issues.", - "icon": "https://bcentral-packageicons.azureedge.net/images/ballerina_io_1.8.0.png" - }, - "codedata": { - "node": "TYPEDESC", - "org": "ballerina", - "module": "io", - "packageName": "io", - "symbol": "AccessDeniedError", - "version": "1.8.0" - }, - "enabled": true - }, - { - "metadata": { - "label": "FileNotFoundError", - "description": "This will get returned if the file is not available in the given file path.", - "icon": "https://bcentral-packageicons.azureedge.net/images/ballerina_io_1.8.0.png" - }, - "codedata": { - "node": "TYPEDESC", - "org": "ballerina", - "module": "io", - "packageName": "io", - "symbol": "FileNotFoundError", - "version": "1.8.0" - }, - "enabled": true - }, - { - "metadata": { - "label": "TypeMismatchError", - "description": "This will get returned when there is an mismatch of given type and the expected type.", - "icon": "https://bcentral-packageicons.azureedge.net/images/ballerina_io_1.8.0.png" - }, - "codedata": { - "node": "TYPEDESC", - "org": "ballerina", - "module": "io", - "packageName": "io", - "symbol": "TypeMismatchError", - "version": "1.8.0" - }, - "enabled": true - }, - { - "metadata": { - "label": "EofError", - "description": "This will get returned if read operations are performed on a channel after it closed.", - "icon": "https://bcentral-packageicons.azureedge.net/images/ballerina_io_1.8.0.png" - }, - "codedata": { - "node": "TYPEDESC", - "org": "ballerina", - "module": "io", - "packageName": "io", - "symbol": "EofError", - "version": "1.8.0" - }, - "enabled": true - }, - { - "metadata": { - "label": "ConfigurationError", - "description": "This will get returned if there is an invalid configuration.", - "icon": "https://bcentral-packageicons.azureedge.net/images/ballerina_io_1.8.0.png" - }, - "codedata": { - "node": "TYPEDESC", - "org": "ballerina", - "module": "io", - "packageName": "io", - "symbol": "ConfigurationError", - "version": "1.8.0" - }, - "enabled": true - }, - { - "metadata": { - "label": "FileWriteOption", - "description": "Represents a file opening options for writing.\n", - "icon": "https://bcentral-packageicons.azureedge.net/images/ballerina_io_1.8.0.png" - }, - "codedata": { - "node": "TYPEDESC", - "org": "ballerina", - "module": "io", - "packageName": "io", - "symbol": "FileWriteOption", - "version": "1.8.0" - }, - "enabled": true - } - ] - } - ] + "items": [] }, { "metadata": { diff --git a/flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/search/source/workspace1/package1/main.bal b/flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/search/source/workspace1/package1/main.bal index b854a21761..1a64a1b853 100644 --- a/flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/search/source/workspace1/package1/main.bal +++ b/flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/search/source/workspace1/package1/main.bal @@ -1,9 +1,7 @@ -import ballerina/io; - public function main() { - io:println("Testing package1 functions"); int result = calculateTotal(10, 20, 30); - io:println(result); + int product = multiply(result, 2); + int[] _ = [result, product]; } # Calculates the total sum of multiple integers diff --git a/flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/search/source/workspace1/package1/timeutils.bal b/flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/search/source/workspace1/package1/timeutils.bal index 1c8cf16782..e1cdcaefb8 100644 --- a/flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/search/source/workspace1/package1/timeutils.bal +++ b/flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/search/source/workspace1/package1/timeutils.bal @@ -1,10 +1,8 @@ -import ballerina/time; - # Gets the current timestamp # -# + return - Current UTC timestamp -public function getCurrentTimestamp() returns time:Utc { - return time:utcNow(); +# + return - Current timestamp in milliseconds +public function getCurrentTimestamp() returns int { + return 0; } # Converts seconds to milliseconds diff --git a/flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/search/source/workspace1/package2/main.bal b/flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/search/source/workspace1/package2/main.bal index 8dc94d394c..958c4a6eff 100644 --- a/flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/search/source/workspace1/package2/main.bal +++ b/flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/search/source/workspace1/package2/main.bal @@ -1,9 +1,7 @@ -import ballerina/io; - public function main() { - io:println("Testing package2 functions"); string message = formatMessage("Hello", "World"); - io:println(message); + string upper = toUpperCase(message); + string _ = reverseString(upper); } # Formats a message with two parts