Store.Project (fnord v0.7.24)

View Source

Summary

Types

index_status()

@type index_status() :: %{
  new: [Store.Project.Entry.t()],
  stale: [Store.Project.Entry.t()],
  deleted: [Store.Project.Entry.t()]
}

t()

@type t() :: %Store.Project{
  conversation_dir: term(),
  exclude: term(),
  exclude_cache: term(),
  name: term(),
  source_root: term(),
  store_path: term()
}

Functions

conversations(project)

@spec conversations(t()) :: [Store.Project.Conversation.t()]

create(project)

@spec create(t()) :: t()

delete(project)

@spec delete(t()) :: :ok

delete_missing_files(project)

@spec delete_missing_files(t()) :: {t(), Enumerable.t()}

exists_in_store?(project)

@spec exists_in_store?(t()) :: boolean()

expand_path(path, project)

@spec expand_path(String.t(), t()) :: String.t()

find_entry(project, path)

@spec find_entry(t(), String.t()) ::
  {:ok, Store.Project.Entry.t()} | {:error, :enoent}

find_file(project, path)

@spec find_file(t(), binary()) ::
  {:ok, binary()} | {:error, :enoent} | {:error, File.posix()}

Resolves path within the project's source root. Returns {:ok, path} if the file exists, or {:error, :enoent} if it does not.

find_path_in_source_root(project, path)

@spec find_path_in_source_root(t(), String.t()) ::
  {:ok, :dir | :file | :enoent, String.t()}

has_index?(project)

@spec has_index?(t()) :: boolean()

index_status(project)

@spec index_status(t()) :: index_status()

Returns the status of the index for the given project.

It classifies entries into:

  • :deleted - entries that were indexed but the source files have been removed
  • :stale - entries whose indexed metadata is stale compared to the source file
  • :new - entries for unindexed files that exist in the source

make_default_for_session(project)

@spec make_default_for_session(t()) :: t()

new(project_name, store_path)

@spec new(String.t(), String.t()) :: t()

relative_path(path, project)

@spec relative_path(String.t(), t()) :: String.t()

save_settings(project, source_root \\ nil, exclude \\ nil)

@spec save_settings(t(), String.t() | nil, String.t() | nil) :: t()

source_files(project)

@spec source_files(t()) :: {t(), Enumerable.t()}

stored_files(project)

@spec stored_files(t()) :: Enumerable.t()

torch(project)

@spec torch(t()) :: :ok