lib/solargraph/library.rb
# Create a file source from a file on disk. The file is ignored if it is
# neither open in the library nor included in the workspace.
#
# @param filename [String]
# @return [Boolean] True if the file was added to the workspace.
Create a file source from a file on disk. The file is ignored if it is
neither open in the library nor included in the workspace.
Create a file source from a file on disk . The file is ignored if it is neither open in the library nor included in the workspace .
def create_from_disk filename
      result = false
      mutex.synchronize do
        next if File.directory?(filename) || !File.exist?(filename)
        next unless contain?(filename) || open?(filename) || workspace.would_merge?(filename)
        @synchronized = false
        source = Solargraph::Source.load_string(File.read(filename), filename)
        workspace.merge(source)
        result = true
      end
      result
    end
def create_from_disk filename result = false mutex . synchronize do next if File . directory? ( filename ) || ! File . exist? ( filename ) next unless contain? ( filename ) || open? ( filename ) || workspace . would_merge? ( filename ) @synchronized = false source = Solargraph :: Source . load_string ( File . read ( filename ) , filename ) workspace . merge ( source ) result = true end result end
Create a file source from a file on disk.
Create a file source from a file on disk .
True if the file was added to the workspace.
True if the file was added to the workspace .
Boolean
filename
<not_specific>
<not_specific>
None