<commit_before>fs = require 'fs'
pathUtils = require 'path'
autocomplete = require './autocomplete'
keywordsRepo = require './keywords'
robotParser = require './parse-robot'
libdocParser = require './parse-libdoc'

STANDARD_LIBS = ['BuiltIn', 'Collections', 'DateTime', 'Dialogs', 'OperatingSystem', 'Process', 'Screenshot', 'String', 'Telnet', 'XML']
EXTERNAL_LIBS = ['FtpLibrary', 'HttpLibrary.HTTP', 'MongoDBLibrary', 'Rammbock', 'RemoteSwingLibrary', 'RequestsLibrary', 'Selenium2Library', 'SeleniumLibrary', 'SSHLibrary', 'SwingLibrary']
STANDARD_DEFINITIONS_DIR = pathUtils.join(__dirname, '../standard-definitions')
EXTERNAL_DEFINITIONS_DIR = pathUtils.join(__dirname, '../external-definitions')
CFG_KEY = 'autocomplete-robot-framework'
MAX_FILE_SIZE = 1024 * 1024
MAX_KEYWORDS_SUGGESTIONS_CAP = 100

# Used to avoid multiple concurrent reloadings
scheduleReload = false

isRobotFile = (fileContent, filePath, settings) ->
  ext = pathUtils.extname(filePath)
  if ext == '.robot'
    return true
  if ext in settings.robotExtensions and robotParser.isRobot(fileContent)
    return true
  return false

isLibdocXmlFile = (fileContent, filePath, settings) ->
  ext = pathUtils.extname(filePath)
  return ext is '.xml' and libdocParser.isLibdoc(fileContent)
<commit_msg>robot extension detection should be case insensitive<commit_after>fs = require 'fs'
pathUtils = require 'path'
autocomplete = require './autocomplete'
keywordsRepo = require './keywords'
robotParser = require './parse-robot'
libdocParser = require './parse-libdoc'

STANDARD_LIBS = ['BuiltIn', 'Collections', 'DateTime', 'Dialogs', 'OperatingSystem', 'Process', 'Screenshot', 'String', 'Telnet', 'XML']
EXTERNAL_LIBS = ['FtpLibrary', 'HttpLibrary.HTTP', 'MongoDBLibrary', 'Rammbock', 'RemoteSwingLibrary', 'RequestsLibrary', 'Selenium2Library', 'SeleniumLibrary', 'SSHLibrary', 'SwingLibrary']
STANDARD_DEFINITIONS_DIR = pathUtils.join(__dirname, '../standard-definitions')
EXTERNAL_DEFINITIONS_DIR = pathUtils.join(__dirname, '../external-definitions')
CFG_KEY = 'autocomplete-robot-framework'
MAX_FILE_SIZE = 1024 * 1024
MAX_KEYWORDS_SUGGESTIONS_CAP = 100

# Used to avoid multiple concurrent reloadings
scheduleReload = false

isRobotFile = (fileContent, filePath, settings) ->
  ext = pathUtils.extname(filePath).toLowerCase()
  if ext == '.robot'
    return true
  if ext in settings.robotExtensions and robotParser.isRobot(fileContent)
    return true
  return false

isLibdocXmlFile = (fileContent, filePath, settings) ->
  ext = pathUtils.extname(filePath).toLowerCase()
  return ext is '.xml' and libdocParser.isLibdoc(fileContent)

{'fraction_non_alphanumeric': 0.12848948374760993, 'fraction_numerical': 0.009177820267686425, 'mean_word_length': 6.369014084507042, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7573024', 'n_tokens_mistral': 857, 'n_tokens_neox': 815, 'n_words': 194}