Intellisense


Image 105

Context based intellisense is provided to each of the activities available when designing a new warewolf service. The file system based activities for example, provide the user with intellisense options based on the local file system.

Intellisense results are generated using the language parser to calculate the list of possible auto-complete options available to a user, given a Datalist and user context. Each of the possible intellisense categories is handled using a provider model. The file system tool for example would use a file system intellisense provider that provides auto-complete options based on the users Datalist and the local file system.

Providers implement the IIntellisenseProvider interface. The GetIntellisenseResults method is responsible for generating intellisense results given an IntellisenseProviderContext. The context includes all necessary inputs required to generate a result.
The current concrete intellisense providers are defined in the Dev2.Intellisense project.

Parsing

The Warewolf data language is parsed using a hand written parser. The language itself is inherently recursive and expressions can be built by recursively evaluating other expressions. The language parser is defined in the Dev2.Data project in a folder called Parsers. The purpose of the parser is to take a language expression such as [[a]][[b]] and split it up into a set of tokens. The tokens are then used to either query the Service’s Data List.

When parsing for intellisense, however the purpose of the parser is to generate a set of regions that can be used to generate a set of auto-complete option. The parser parses a string into a set of tokens and split the tokens into a set of well-formed and non-well-formed regions. These regions are then compared to the variable list and a set of auto-complete results is generated.

Cet article vous a-t-il été utile ?